不工作我在.htaccess自定義404路的ErrorDocument htaccess的
ErrorDocument 400 /abc/404
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/ - [S=2]
RewriteRule ^abc/(.*)/(.*)$ index.php?aa=$1&bb=$2 [NE,L,QSA]
RewriteRule ^abc/(.*)$ index.php?aa=$1 [NE,L,QSA]
下面的代碼,但是我提示以下錯誤:每當我經過一個錯誤的URL
Not Found
The requested URL /abc/[S=2] was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
如果我刪除線RewriteRule ^/ - [S=2]
那麼我提示以下錯誤:
Not Found
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
當我嘗試http://example.com/abcd/
我想要.htaccess重定向到http://example.com/abc/404
這是一個頁面
我在做什麼錯誤。請幫幫我。
在此先感謝
是'/ ABC/404'有效的網址?如果是,那麼在你的問題中發佈完整的.htaccess。 – anubhava
感謝Anubhava。我用完整的代碼更新了問題,我正在等待你的幫助。我請求你,如果你能幫助我,上面這將是非常偉大的。謝謝 –
好吧,讓我試試。 – anubhava