1. 程式人生 > >tp3.2.3如何隱藏index.php

tp3.2.3如何隱藏index.php

開發十年,就只剩下這套架構體系了! >>>   

在.htaccess這個檔案中,框架初始是:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.)$ index.php/$1 [QSA,PT,L]
</IfModule>
只需要改成這樣(只有最後一行有所改變):


<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
**RewriteRule ^(.
)$ index.php [L,E=PATH_INFO:$1]**<