TP5中隱藏入口檔案的問題
阿新 • • 發佈:2019-01-23
使用phpstudy和linux部署的時候
tp5中的官方說明是在入口檔案的同級目錄下新增一個.htaccess檔案
檔案內容如下:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
這個配置在phpstudy和linux下並沒有效果
如果是在phpstudy和linux下面.htaccess檔案裡面的內容應該改成:
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>