【发布时间】:2019-06-17 19:32:06
【问题描述】:
我用谷歌搜索了很多,但我找不到从这两种情况中删除 index.php 的任何规则:
- domain.com/index.php => domain.com
- domain.com/index.php/other/stuff => domain.com/other/stuff
这是我到目前为止所做的
RewriteRule .* index.php [L]
RewriteCond %{REQUEST_URI} !(administrator) [NC] #exclude administrator folder
#RewriteRule ^index.php$ /$1 [R=301] #when this is enable work only first case
RewriteRule ^(.*)index.php$ /$1 [R=301,L] #when this is enable work only second case
如果我启用这两种情况,所有请求都会重定向到 domain.com
谢谢。
【问题讨论】: