【发布时间】:2021-08-17 21:53:43
【问题描述】:
我需要从内页中删除 index.php,以便像 /index.php/path 这样的 URL 路径将只是 /path。但是,如果路径是/index.php/,那么不要删除 index.php 并保留所有内容。我在.htaccess 中尝试以下几行:
RewriteCond %{REQUEST_URI} !^.*/index.php/$ [NC]
RewriteRule /index.php/(.+)$ /$1
但是他们删除 index.php 总是包括路径是/index.php/
【问题讨论】: