Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    North East England
    Posts
    853
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question .htaccess rewrite *.shtml to *.html

    As titled really, I'm thinking I might change out my SSI for php includes, inorder to keep links operational until they're changed or filter out I'd like to change requested .shtml files to .html, how?

    thanks
    [+] Computer/PC issues [+] Silverpaw3D
    ------------------------------------------------
    Never buy a dwarf with learning disabilities...

    ...it's not big, and it's not clever.

  • #2
    Regular Coder Feyd's Avatar
    Join Date
    May 2002
    Location
    Los Angeles, CA Maxim: Subvert Society
    Posts
    404
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, I think this exact question came up a while ago...

    Code:
    <Directory "httpd local directory path">
    	RewriteEngine  on
    	RewriteBase /
    	RewriteRule ^(.*)\.shtml$ $1.html [R=permanent]
    </Directory>
    --or--

    Code:
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.shtml$ $1.html [R=permanent]
    or this would check to see if the html version of the requestes shtml page exists before redirecting
    Code:
    RewriteEngine on
    RewriteBase /
    RewriteRule ^(.*)\.shtml$ $1 [C,E=WasSHTML:yes]
    RewriteCond %{REQUEST_FILENAME}.html -f
    RewriteRule ^(.*)$ $1.html [S=1,R]
    RewriteCond %{ENV:WasSHTML} ^yes$
    RewriteRule ^(.*)$ $1.html
    Here's the original thread if you need it : http://freewarejava.com/ubb/Forum5/HTML/004908.html
    Moderator, Perl/CGI Forum
    shadowstorm.net - subvert society


  •  

    Posting Permissions

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