0
我是CI的全新用戶,我試圖從網址中刪除惱人的「index.php」。這是我使用的.htaccess:CodeIgniter 2在修改.htaccess後不再能夠使用PATH_INFO
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
正如你所看到的,我必須使用QUERY_STRING
以使新的URL工作(注意問號的index.php後)。當我嘗試使用PATH_INFO
(即沒有問號)時,我只收到No input file specified
錯誤。
這很好,如果需要我可以使用QUERY_STRING
,但是我不明白這個問題,因爲我在開始玩重寫之前使用了PATH_INFO
就好了 - 例如,默認的「example .com/index.php/controller/function「正在工作,並使用PATH_INFO AFAIK。
有誰知道爲什麼在我的例子中htaccess打破PATH_INFO?對不起,這個愚蠢的問題。