2012-02-19 132 views

回答

2

使用ErrorDocument時,您指定的文件是相對於DOCUMENT ROOT而不是.htaccess的位置!

編輯:
假設你有notfound.html,你想使用它的文件夾dir01,您創建一個htaccess文件,該文件夾內,補充一點:

ErrorDocument 404 /dir01/notfound.html 

如果您要訪問您的文件在瀏覽器(notfound.html),這將是http://www.example.com/dir01/notfound.html。這就是我所能解釋的!

+0

OK,一個這到底是指?我不明白 – Master345 2012-02-19 20:28:30

+0

額外的解釋! – undone 2012-02-19 22:04:32

+0

謝謝你,這是最好的答案永遠:) – Master345 2012-02-20 00:41:13

0

你可以在你的.htaccess文件中使用下面的代碼:

RewriteBase/

+0

仍然不工作....你可以發佈一個完整的代碼? – Master345 2012-02-19 20:29:29

+0

在你的.htaccess: '上 RewriteEngine敘述RewriteBase/ 的ErrorDocument 404/notfound.html' – ChoiZ 2012-02-19 20:40:00