2 Replies Latest reply on May 8, 2006 8:23 AM by Newsgroup_User

    - Configuring file extensions to look for in .htaccess

    Level 7
      I used to have this feature on my old server (server admin configured it),
      and I'm trying to get it working on my new one on my own (through
      .htaccess).

      I'd like a hyperlink like "/songs/songname" to look for a folder called
      "songname" first (which is what it already does by default) * BUT * if there
      isn't any folder called "songname", it should look for FILENAMES called
      "songname" and match various extensions to it until there's a match.

      So "yourdomain.com/songs/songname.php" could also be called with
      "yourdomain.com/songs/songname" (no extension).

      And if there's 3 files with the same name in the same directory using 3
      different extensions, then the server should fetch the extension I want
      first... Then if it's not there, look for another... And so on, until all
      the usual suspects have been exhausted.

      How does one configure an .htaccess file to do this?


        • 1. (Take 2) Configuring file extensions to look for in .htaccess
          Level 7
          Anyone?

          "Reese" <no@spam.com> wrote in message
          news:e3l6be$c5s$1@forums.macromedia.com...
          >I used to have this feature on my old server (server admin configured it),
          >and I'm trying to get it working on my new one on my own (through
          >.htaccess).
          >
          > I'd like a hyperlink like "/songs/songname" to look for a folder called
          > "songname" first (which is what it already does by default) * BUT * if
          > there isn't any folder called "songname", it should look for FILENAMES
          > called "songname" and match various extensions to it until there's a
          > match.
          >
          > So "yourdomain.com/songs/songname.php" could also be called with
          > "yourdomain.com/songs/songname" (no extension).
          >
          > And if there's 3 files with the same name in the same directory using 3
          > different extensions, then the server should fetch the extension I want
          > first... Then if it's not there, look for another... And so on, until all
          > the usual suspects have been exhausted.
          >
          > How does one configure an .htaccess file to do this?
          >


          • 2. Re: - Configuring file extensions to look for in .htaccess
            Level 7
            .oO(Reese)

            >I'd like a hyperlink like "/songs/songname" to look for a folder called
            >"songname" first (which is what it already does by default) * BUT * if there
            >isn't any folder called "songname", it should look for FILENAMES called
            >"songname" and match various extensions to it until there's a match.

            You might want to have a look at content negotiation, especially the
            MultiViews option.

            Content Negotiation
            http://httpd.apache.org/docs/1.3/content-negotiation.html

            HTH
            Micha