Redirecting to the homepage, not the 404 error page!

I am working with PHP. I have a .htaccess file as shown below and it is redirected to the home page and not the 404 error page: / what could be the problem here? Valuing helps! thanks a lot!

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]
+3
source share
5 answers

A URL or your document with an error /new/err404.htmlwithout a path prefix /new/is simple err404.html. And that will be in accordance with your third rule.

You can extend this rule and exclude such error documents:

RewriteCond $1 !^err[45][0-9][0-9]$
RewriteRule ^([^/]*)\.html$ index.php?s=$1 [QSA,L]
+4
source

, : 404 ?

, /, Google . , 404.

404 Google, A-ok, , , Google .

, , 5000 - Google 5000 URL- - , , 404?

404. , , .

+1

404? :

 ErrorDocument 404 /new/err404.html

? , 404 , ?

0

.htaccess,

ErrorDocument 404 http://www.yoursite.com/pagename.html
0

. . , /index.html /404.html - .

-1

Source: https://habr.com/ru/post/1720064/


All Articles