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

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

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