简体   繁体   English

如何停止网站在URL中显示index.php

[英]how to stop site showing index.php in the URL

My site is resolving with both: 我的网站同时解决了这两个问题:

https://www.itcontractorsuk.com AND https://www.itcontractorsuk.com/index.php https://www.itcontractorsuk.comhttps://www.itcontractorsuk.com/index.php

What can I do so that the extra index.php doesn't show up in the URL. 我应该怎么做才能使多余的index.php不会出现在URL中。 It's only happening with homepage. 这只发生在首页上。

RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php
RewriteRule ^index\.php$ / [L,R=301]

Should do the trick. 应该做到的。

Put this in your .htaccess 把它放在你的.htaccess文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM