我以前做过这个,就像一行代码。现在,当我查找它时,只有 5-10 行,用于将 index.php 重定向到 .htaccess 中的根目录 (/
)。
最好的方法是什么?
最佳答案
这段代码对我有用
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
关于.htaccess - 将index.php重定向到root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16060876/