任何人都可以建議嗎?我想有遊客到我的網站的默認頁爲的index.php和所有不存在的網頁訪問者應該看到errordoc.phpErrorDocument似乎並沒有在我的.htaccess中工作
所以我把這個在.htaccess:
ErrorDocument 404 /errordoc.php
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} !^mysite\.org\.uk$ [NC]
RewriteRule ^(.*)$ http://mysite.org.uk/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
不幸的是,一切都會index.php,包括錯誤。我試過問我的朋友谷歌,但今天是休息日!
陌生,它看起來不錯。如果您刪除重寫部分,它是否工作? – 2010-09-09 11:12:06
感謝Pekka,我已經刪除了最後一條重寫規則,現在它工作得很好。 – user114671 2010-09-09 11:41:21
並把所有其他東西留在原地? LOL – 2010-09-09 11:54:45