htaccess 301重定向到主页/索引页面

时间:2016-08-02 07:38:53

标签: .htaccess redirect

1 个答案:

答案 0 :(得分:0)

您可以使用此规则从您的网址中删除index.php

RewriteEngine On

# remove index.php, MAKE SURE THIS IS YOUR FIRST RULE
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteCond %{REQUEST_URI} ^(.*/)index\.php$ [NC]
RewriteRule ^ %1 [L,R=301,NE]