R
R
Rodion2021-10-02 03:20:08
htaccess
Rodion, 2021-10-02 03:20:08

404 error with no change in address bar?

Hello

There is a site, let's say site.ru, if you go to a non-existent page, for example site.ru/ololo01, it automatically redirects to site.ru/404. I need that when I go to a non-existent page, for example site.ru/ololo01, NOT the site.ru/404 page opens, but directly on the non-existent site.ru/ololo01 page, the inscription 404 appears on this page. Without redirects to the site.ru/404 page .

I summarize
We go to site.ru/ololo01 the page does not exist => redirects to site.ru/404 BAD We go to
site.ru/ololo01 the page does not exist => the code 404 appears on the same page without changing the address bar non-existent pages were displaying a 404 error with no change in the address bar


site.ru/ololo01 -> site.ru/404 Bad

site.ru/ololo01 -> site.ru/ololo01 Good, my 404 image appears

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wisgest, 2021-10-02
@wisgest

There is a site, let's say site.ru, if you go to a non-existent page, for example site.ru/ololo01, it automatically redirects to site.ru/404.

How did you do it?
If suddenly you have a .htaccess set
ErrorDocument 404 http://example.com/404.html
to correct
ErrorDocument 404 /404.html
(remove protocol and host).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question