Results 1 to 6 of 6
  1. #1

    File type redirects with htaccess?

    I've got a good-sized site with around 300 HTML pages. I'm doing some restructuring and changing all the HTML files to SHTML to take advantage of SSI. I plan on keeping filenames the exact same, just changing the extension - i.e. to

    I'd like to use .htaccess to tell visitors looking for the HTML files to automatically go to the SHTML files. I don't really want to put 300+ lines of redirects in .htaccess, so I was wondering how I could make it so that [filename].html gets redirected to [filename].shtml automatically.

    I do not plan on having any HTML files on the site any longer. So ANY request for an HTML should be forwarded to the SHTML version.

    Does this make sense? Could anyone clue me in on how the language in htaccess should look? I appreciate any help.

  2. #2
    Join Date
    Jun 2004
    Northwest Colorado
    You're into mod_rewrite territory there, which can be implemented in an .htaccess file. Sorry, I'm not any good with mod_rewrite, but I do know it's what you're after.
    Eric J. Bowman, principal
    Bison Systems Corporation coming soon: a new sig!
    I'm just a poor, unfrozen caveman Webmaster. Your new 'standards' frighten, and confuse me...

  3. #3
    I think I might have it.

    I've got cPanelX, and under "Apache handlers" I've got:

    .cgi .pl cgi-script
    .shtm server-parsed
    .shtml server-parsed

    Shouldn't I just be able to add:

    .html server-parsed

    And not even have to bother renaming all of my HTML files to shtml??

  4. #4
    Join Date
    Jun 2004
    Northwest Colorado
    Heheh... Yeah, I shoulda thought of that...

  5. #5
    So that should work? I'm a little leery of just jumping in and doing it on a live site without a second opinion. ;-)

  6. #6
    Join Date
    Sep 2003
    You mean something like:

    directory is not a folder. it is actually a php file.

    I made a .htaccess file and made it look like:
    <files directory>
    SetHandler application/x-httpd-php
    AIM: GopherDesign
    ICQ: 39 401 865

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts