我要更新一个网站的所有页面使用包括页脚和头。所以我要改变很多。html的网页,以.PHP。
所以我在寻找一种方法来重定向以.html相同的URL结束所有的网页,但以.php结尾。
解决方案 RewriteEngine叙述上
重写规则^(。*)。HTML $ $ 1.PHP [L]
如果你想让它做一个重定向,而不是仅仅重写修改 [L]
到 [L,R]
I want to update all the pages on a website to use include for the footer and header. So I have to change a lot of .html pages to .php.
So i'm looking for a way to redirect all pages that end with .html to the same url but ending in .php.
解决方案RewriteEngine On
RewriteRule ^(.*).html$ $1.php [L]
If you want it to be done as a redirect instead of just a rewrite modify the [L]
to [L,R]