
現在我的 httpd.conf 檔案中有以下內容:
ErrorDocument 404 /index.html
這可行,但我需要一個額外的規則來處理我的偵錯路徑。例如,如果我請求
http://www.mypage.com/debug/page-that-does-not-exist.html
我希望它重定向到:
/debug/index.html
而不是我的文檔根目錄中的索引。實現這一目標最簡單的方法是什麼?
答案1
<Directory /debug>
ErrorDocument 404 /debug/index.html
</Directory>