我有這個網址http://xxxxxxxxx.com/account/session/login/redirect/%2Fhotel%2Frooms%2Findex%2Fhot_id%2F1它使用Zend Framework(PHP)。在.htaccess的幫助下錯誤報告404使用Apache(.htaccess重寫)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [NC,L]
事情是我得到404未找到。爲了確保它是Apache,我退出了index.php主文件,當它啓動並且apache仍然報告404時。在退出之前沒有執行php的代碼。
編輯
我的域的阿帕奇domlog顯示此行
190.78.208.30 - - [25/Aug/2011:17:48:17 -0430] "GET /account/session/login/redirect/Fhotel%2Frooms%2Findex%2Fhot_id%2F1 HTTP/1.1" 404 25821 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0"
但沒有在error_log中有關管線
EDIT 2
如果有用我運行Apache 2.2.19,PHP 5.3.6,cpanel 11.30.2,CentO小號5.6
請注意404未找到。當我在執行其他任何事情之前退出index.php時,404仍然出現。我可以確定.htaccess正在被讀取。我推薦了一個
SetEnv MYENV 1
並且顯示在同一個域中的phpinfo()中。我只是再次檢查我的access_log和error_log,並保持如上所述。
任何想法,爲什麼發生這種情況?
錯誤日誌應該準確顯示apache嘗試爲該請求加載的文件/路徑。您也可以打開mod-rewrite調試,以確切瞭解事情如何被重寫。 –
試試這個:RewriteEngine on RewriteRule!。(js | ico | gif | jpg | png | css)$ index.php – opHASnoNAME