我都用
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]
或最近:
FallbackResource /index.php
拥有 Web 应用程序的单一入口点 (/index.php)。
但是我无法删除应用程序根 url 路径的 url 中的“index.php”:
https://www.test.com/contacts works (as for all other endpoints below the root)
https://www.test.com rewritten as https://www.test.com/index.php
https://www.test.com/ rewritten as https://www.test.com/index.php
https://www.test.com/index.php if possible should be rewritten as https://www.test.com
有没有办法保持 url 根路径“干净”?