X
X
Xrist1An2014-11-16 09:36:09
PHP
Xrist1An, 2014-11-16 09:36:09

How to find out the referral after a redirect?

One site implements a redirect to the 404.php page in case some GET parameters for the page are incorrect. How can you find out which page the user originally requested and from which he was subsequently redirected to 404.php?
$_SERVER['HTTP_REFERER'] is empty. Why?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
FanatPHP, 2014-11-16
@FanatPHP

redirect to 404.php page

That's why.
More enchanting stupidity cannot be imagined.
Instead of Not Found, the client receives a response... Found(!) and is then redirected to a page where Not Found is returned.
Pogda and stupid questions "where did the referrer go" will not arise.

X
xmoonlight, 2014-11-16
@xmoonlight

Another option is to find out the referee? Easier.

1. Catch the referrer on the router (php script for entering the application).
2. There is no single point - to organize "interception" via .htaccess on your router (you need to write a referral entry there wherever you want) and then - to give it to the requested REQUEST_URI through the QSA flag.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question