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
Post a Comment