目前我的 htaccess 文件包含此规则,将 website.org/index.php 重定向到 website.org/en/home
RewriteRule index.php /en/home [R=301]
不过,目前还有其他
index.php
更深层文件夹中的页面重定向!例如website.org/folder/index.php
重定向到 website.org/en/home
我怎样才能让该规则仅适用于根目录,而不适用于更深的文件夹?
非常感谢。
最佳答案
RewriteRule ^index.php /en/home [R=301]
关于apache - 如何通过 .htaccess 正确地将 index.php 重定向到另一个页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5205881/