Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我计划从我的网页中删除 .php 扩展名。我已经有了要使用的 .htaccess 文件的代码;
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]
在我开始编辑文件之前,我有一个问题;
当我这样做时,使用 GET 方法的页面会发生什么情况?例如 index.php?mode=logout
这仍然有效吗?如果没有,是否有解决方法?
您可以包含QSA以保持查询字符串的完整性。
RewriteRule ^([^\.]+)$ $1.php [NC,L,QSA]