J
J
jorshjorsh952018-08-24 08:19:31
Apache HTTP Server
jorshjorsh95, 2018-08-24 08:19:31

Why is ErrorDocument 404 giving 302?

Good afternoon, in htaccess:
ErrorDocument 404 http://site.ru/404.php
All pages are strictly html files, but when accessing a non-existent one, for example site.ru/men21djakd.html, it
redirects to 404, and everything seems to be fine, but the server returns 302, but you need 404 right away.
Please tell me how to implement (there is no single entry point to solve this php case)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-08-24
@dodo512

https://httpd.apache.org/docs/2.4/mod/core.html#er...
Anything that starts with http:// https:// is treated as an external resource, even if it links to the same domain.
The redirect is due to the schema and host specification.
ErrorDocument 404 /404.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question