htaccess rewrite rule for changing html and htm extensions to php -


i changing website has pages ending .htm , pages ending .html php.

all site names, folders , structures remain same , extension change .htm , .html .php.

what correct rewrite rule .htaccess file in regards?

after research came following , want make sure correct:

rewriterule ^(.*).htm /$1.php [r=301,l] rewriterule ^(.*).html /$1.php [r=301,l] 

would above code in .htaccess file correct , there else have include?

your rules fine, have turn rewrite engine on first..

rewriteengine on 

then add rules:

rewriterule ^(.*)\.htm /$1.php [r=301,l] rewriterule ^(.*)\.html /$1.php [r=301,l] 

Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -