深入分析url的伪静态之如何去掉index.php

2024-10-30 23:23:09
有1个网友回答
网友(1):

这还用深入分析么?
QueryString参数用:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?$1 [QSA,PT,L]
PathInfo参数用:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]