我的网址是
www.abc.com/cbn/either/index.php
我只想通过当前 url 访问它。当我改变路径时 index.php 文件,即
www.abc.com/cbn/index.php
不过,我正在访问 index.php 文件,从 SEO 的角度来看,这是一种糟糕的方法,因为现在谷歌将索引同一文件的两个 URL。所以请帮我解决这个问题。
最佳答案
在你的 htaccess 中的 RewriteBase 之后添加这样的行
RewriteRule cbn/index.php /cbn/either/index.php [R,L]
关于php - 如何使用 htaccess 避免 php 中同一文件的多个路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30347932/