M
M
Maxim Barulin2013-08-07 16:37:08
PHP
Maxim Barulin, 2013-08-07 16:37:08

Tracking 404 page?

Good day Habr!
There was a problem. htaccess has a 404 redirect.
ErrorDocument 404 /errors/404/
and everything seems to be fine, everything works. But there was a need to determine and log the pages from which the user was thrown to the error page. And this is where the hitch arose. Apache, when redirecting somewhere, loses the address that was in the address bar before the redirect. Those. I can not determine the page that was driven in the browser / link. Neither HTTP_REFERER nor REDIRECT_URL has it. Perhaps you can somehow configure the redirect so that the address also comes, albeit in the form of a GET parameter. Anywhere

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Z
ZmeeeD, 2013-08-07
@ZmeeeD

But it seemed to me that this is not how it is done ...
Url should not change, the response from the server should change, its own custom page with excuses or something else.

M
Maxim Barulin, 2013-08-08
@Slavenin999

I found the root of the problem, but I have no idea how to solve it. As it turned out, there is a bunch of apache + nginx on the server, respectively, first nginx intercepts control, sees 404 issues 301 redirects, then Apache picks up control and shows the page, but when redirecting, the initial data of the $_SERVER array is lost. Can anyone suggest how to solve this problem?

T
torf, 2013-08-22
@torf

del.the problem was solved without me

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question