【发布时间】:2018-05-06 19:47:33
【问题描述】:
我想通过以下方式重定向到我的 htaccess:
http://example.com/index.php -> http://example.com
http://example.com/index.php/controller -> http://example.com/controller
http://example.com/index.php/controller/any-method -> http://example.com/controller/any-method
简而言之,我想检测 URL 是否包含 index.php 并将其重定向到没有它的 url,但要在 index.php 之后保留其他段
提前谢谢你。
【问题讨论】:
标签: regex apache .htaccess redirect mod-rewrite