我正在使用PHP。我有一个像下面这样的.htaccess文件,它将重定向到主页而不是404错误页面:/ 这里可能出了什么问题?感谢帮助!非常感谢!
ErrorDocument 404 /new/err404.html
RewriteEngine On
RewriteBase /new/
RewriteRule ^login.html$ index.php?s=login&a=loginDo [QSA,L]
RewriteRule ^logout.html$ index.php?s=login&a=logoutDo [QSA,L]
RewriteRule ^([^/]*).html$ index.php?s=$1 [QSA,L]
RewriteRule ^members/([^/]*)$ index.php?s=profile&username=$1 [QSA,L]
RewriteRule ^([^/]*)/$ index.php?s=listing&search[cityString]=$1 [QSA,L]
RewriteRule ^([^/]*)/([^/]*)/$ index.php?s=listing&search[neighborhoodString]=$2 [QSA,L]
RewriteRule ^([^/]*)/([^/]*)/([^/]*).html$ index.php?s=details&seo_friendly=$3 [QSA,L]
/new/err404.html
)。这是适当的行为。但如果您现在想重定向到其他内容(并且如果您在ErrorDocument
中指定绝对URL,则会发生这种情况),则服务器将使用302状态码而不是适当的404状态码。302意味着“所请求的资源存在,请使用以下位置检索它”。 - Gumbo