【发布时间】:2023-04-08 08:23:01
【问题描述】:
我有一个 htaccess 文件,它将所有流量重定向到我的 index.php 以进行路由。
该应用也可以使用这样的网址“example.com/index.php/blog/”
如果 url 看起来像“example.com/index.php/blog/”,我会尝试 404,但让 url “example.com/blog/”通过
Htaccess 文件
# Send the URI to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
提前谢谢!
【问题讨论】:
标签: php apache .htaccess mod-rewrite redirect