Answer the question
In order to leave comments, you need to log in
How to make a 404 error for pages in a folder as well?
Hello. I have a site on bare html
in .htaccess code like this
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
ErrorDocument 404 /404.php
works fine, if you go to a non-existent page site.ru/miss it will throw an
error.
but if the page is already in the
site.ru/page/miss folder, it
does not knock out an error.
I tried to write in ErrorDocument the full address of the page 404 ErrorDocument 404 site.ru/404.php
then everything works for all pages, but only with a redirect from a non-existent page to the site.ru/404.php page. Which doesn't suit me.
do not tell me how to make 404 for all types of pages?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question