我遇到了永久.htaccess代碼阻止自定義錯誤處理的問題。當我刪除WordPress代碼時,錯誤處理工作正常。WordPress .htaccess和ErrorDocument 400
這裏是我的代碼:
php_value memory_limit 96M
php_value upload_max_filesize 250M
php_value post_max_size 250M
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
ErrorDocument 400 /error.php
AddType application/msword doc
AddType application/vnd.ms-excel xls
AddType application/powerpoint ppt
AddType application/vnd.ms-word.document.macroEnabled.12 .docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/vnd.ms-powerpoint.template.macroEnabled.12 potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/vnd.ms-powerpoint.addin.macroEnabled.12 ppam
AddType application/vnd.ms-powerpoint.slideshow.macroEnabled.12 ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/vnd.ms-powerpoint.presentation.macroEnabled.12 pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/vnd.ms-excel.addin.macroEnabled.12 xlam
AddType application/vnd.ms-excel.sheet.binary.macroEnabled.12 xlsb
AddType application/vnd.ms-excel.sheet.macroEnabled.12 xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/vnd.ms-excel.template.macroEnabled.12 xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
有沒有辦法讓WordPress的代碼不變,仍然有400錯誤自定義錯誤文檔?
由於提前,
斯科蒂
感謝您的答覆。我添加了鏈接到我創建的頁面,如下所示: ErrorDocument 400/page-name/ 這仍然會產生相同的結果。有沒有不同的語法我缺少? – Scotty 2012-02-06 21:14:17
這應該解釋我在說什麼。 http://codex.wordpress.org/Creating_an_Error_404_Page – thenetimp 2012-02-07 04:34:30