我正在尝试了解如何将网站上的所有stream量从任何.htm地址redirect到页面的.php版本。 我希望这将是一个.htaccess的规则,但我还没有find任何适合我的东西,我不是最大的.htaccess。
任何帮助不胜感激。
这将在你的.htaccess文件中完成这项工作:
RedirectMatch 301 (.*)\.htm$ $1.php
RewriteEngine on RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC] RewriteRule ^ /%1.php [NC,L,R]
这会将file.html重定向到file.php,而不会导致无限循环错误。