不工作我在.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