繁体   English   中英

如何使用 htaccess 删除 url 中的 index.php

[英]How to remove index.php in url using htaccess

为什么不使用 htaccess 删除 index.php

Options +MultiViews

RewriteEngine On

RewriteCond %{REQUEST_FILENAME}.php -f

RewriteRule !.*.php$ %{REQUEST_FILENAME}.php [QSA,L]

这将帮助您:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM