0
我在我的Mac上運行本地主機XAMPP,並試圖建立與mod_rewrite的Apache服務器,這是我在.htaccess
代碼(這是在htdocs目錄)的mod_rewrite不工作 - 導致404錯誤,沒有日誌
<IfModule mod_rewrite.c>
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^test/?$ api/rest/v1.0/api_controller.php?request=$1 [NOCASE,LAST] # Handle requests for 「test"
RewriteLog "logs/rewritelog"
RewriteLogLevel 7
</IfModule>
這也是.htaccess
文件中唯一的代碼。
當我在我的瀏覽器中嘗試我的鏈接http://localhost/test/1
時,我只是被定向到404錯誤。
我已經在htdocs/logs/rewritelog下進行了檢查,但是沒有任何文件甚至是一個名爲logs的文件夾。
UPDATE
我運行的Apache 2.4.10版
您沒有匹配'/ test/1'的重寫規則。也許嘗試'^ test /(.*)$' – Phil 2014-12-08 02:26:32
謝謝,但仍然沒有運氣 – 2014-12-08 02:28:51
爲什麼沒有日誌的任何想法? – 2014-12-08 02:30:13