在我的htaccess文件中,我的ErrorDocument 404語句沒有重定向到index.php。相反,我得到一個常規的404錯誤。這是一個常規的Apache安裝。404重定向不起作用
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
可憐的你!我真的希望你能理清這一點 – 2010-07-08 15:46:06
你正在使用哪種瀏覽器來測試它? – Sjoerd 2010-07-08 15:48:06
你知道你是否啓用了mod_rewrite(你可以用'echo phpinfo()')來檢查嗎?此外,你是什麼意思的「正規404」。你的意思是Apache的404或CI的? – 2010-07-08 15:49:21