Javascript 无效链接没有重定向到404页,可能是.htaccess问题
我试图重新定向404页的无效链接,但没有发生。例如:-localhost/project1/complaints/category-is-here.html 现在“category is here.html”不存在,它应该被重新定向到404页面 但不是重定向到404错误。 此页面显示页面中的文本“category is here.html” 如果我在浏览器中随机更改名称,例如:- localhost/project1/complaints/category145asdsa在这里(无论我在link中键入了什么) 它在页面中显示新文本“category145asdsa在这里(无论我在link.html中键入了什么),而不是重定向到404页面Javascript 无效链接没有重定向到404页,可能是.htaccess问题,javascript,php,html,.htaccess,redirect,Javascript,Php,Html,.htaccess,Redirect,我试图重新定向404页的无效链接,但没有发生。例如:-localhost/project1/complaints/category-is-here.html 现在“category is here.html”不存在,它应该被重新定向到404页面 但不是重定向到404错误。 此页面显示页面中的文本“category is here.html” 如果我在浏览器中随机更改名称,例如:- localhost/project1/complaints/category145asdsa在这里(无论我在link
htaccess
RewriteEngine on
ErrorDocument 404 /page-not-found.html
RewriteRule ^(.*)/$ /$1 [R,L]
RewriteRule ^complaints/(.*)/(.*)/(.*)-(.*).html$ complaint-info.php?ticket-number=$4
RewriteRule ^complaints/(.*)/(.*)$ complaint-listing.php?sub-category=$2
RewriteRule ^complaints/(.*)$ sub-listing.php?category=$1
RewriteRule ^page-not-found.html$ 404.php
我希望你能理解我的问题
问候
发展