URL 在我的应用程序中运行良好。我的意思是它们都是漂亮的网址。喜欢http://www.example.com/ http://www.example.com/但当您使用以下命令访问页面时它也有效索引.php like http://www.example.com/index.php http://www.example.com/index.php,我不想要它,因为它在一页的站点地图中显示两个链接。一页无索引.php另一个与索引.php。站点地图的演示在这里https://www.xml-sitemaps.com/details-eln.6762418.html https://www.xml-sitemaps.com/details-eln.6762418.html
这里是.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
输入以下代码:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,7}\s/(.*)index\.php\sHTTP.*$
RewriteRule ^ /%1 [R=301,L]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)