
我目前正在嘗試為網站內的單獨資料夾設定 2 組不同的錯誤文件。
我在網站的根目錄中有 2 個資料夾:
demo/
live/
在演示資料夾中傳回 404 或 403 的任何請求都需要載入 Apache 錯誤文件的一組頁面,例如:
ErrorDocument 404 /statuses/demo-404.html
ErrorDocument 403 /statuses/demo-403.html
並且 live 需要轉到類似名稱的檔案。
ErrorDocument 404 /statuses/live-404.html
ErrorDocument 403 /statuses/live-403.html
到目前為止,我已經嘗試在兩個目錄中放置一個 .htaccess 文件,並使用指向特定文件的 ErrorDocument 指令設置,404 工作正常並引用正確的頁面。但是,當嘗試存取演示目錄中的禁止資料夾時,403 不起作用並恢復為伺服器預設值,日誌指示以下內容:
[Wed Jun 16 04:47:44 2010] [crit] [client 115.64.131.144] (13)Permission denied: /home/abstract/public_html/demo/xxx/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
它是否正確? apache 會恢復預設狀態嗎,因為它試圖在它沒有權限的資料夾中尋找 htaccess ?為什麼它不能通過資料夾樹返回?我可以讓它這樣做嗎?