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]
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.
/new/err404.html
/new/
err404.html
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]
, : 404 ?
, /, Google . , 404.
404 Google, A-ok, , , Google .
, , 5000 - Google 5000 URL- - , , 404?
404. , , .
404? :
ErrorDocument 404 /new/err404.html
? , 404 , ?
.htaccess,
ErrorDocument 404 http://www.yoursite.com/pagename.html
. . , /index.html /404.html - .
Source: https://habr.com/ru/post/1720064/More articles:How can I read a directory in Perl with one statement? - directoryHow can I make UserControls code inherit the base class? - inheritanceВключить действие реферера через фильтр действий? - asp.net-mvcjQuery simple modal + asp.net - jqueryopenCV, combining the image with another image at the given coordinates - c ++how to tessellate bezier triangles? - renderingExecuting sql file on SQL Server using C # - c #Can I have compound constraints? - sql-serverFailed to verify viewstate MAC address. when submitting a form using javascript - javascriptWPC TabControl с иконками переполнения - wpfAll Articles