permanent redirect for all shtml files to... php (but without extension)

Discussion in 'Apache' started by martinvidic, Apr 28, 2012.

  1. #1
    Hi there.
    just changed my site from shtml to php and I am using this to rewrite files without dot-php extension
    RewriteCond %{REQUEST_FILENAME}\.php -f 
    RewriteRule ^(.*)$ $1.php
    Code (markup):
    But now I need a permanent 301 redirect for ALL my old shtml links.
    Does anybody know how to do that?

    THANX:
    mavi
     
    martinvidic, Apr 28, 2012 IP
  2. martinvidic

    martinvidic Guest

    Messages:
    182
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've tried to combine it with this:
    RewriteRule ^(.+)\.php$ $1 [L,NC,R=301]

    But it still doesn't work :(

    Im basically trying to parse shtml as php...
    AddType application/x-httpd-php .shtml

    and redirect myfile.shtml to myfile at the same time
     
    martinvidic, Apr 28, 2012 IP