http - How can I detect if page was requested via a redirect? -


Loads of redirects that go to a particular page on a customer's website. This page should know in any way whether the request was direct (URI is manually typed) or redirect.

  1. All redirects are 301 redirects. Due to SEO regulations, the added indicators should be avoided. (Google with different values ​​to the URL)

  2. I have tried to check all the environment variables, but all of them are empty (which is normal) and There is no internal redirection in this regard, I think differently (I think).

  3. Detection needs to be real time, so log files are not an option. In a nutshell process, parameters are registered in cookies through a script, then it is redirected to 301 on the page where the content cookie is operated.

    I hope this makes sense.

    Previous: I was thinking about the situation when the content is registered, the content will not change back to the original. Code, but I'm not sure whether there is any way to read on the destination page. (We have made it clear that this will not work)

Based on browser and intermediate proxy, many Things may happen, however, in most cases you can not depend on anything. The status code is something that sends back to the server browser, so you will not get them on request.

You do not say that you are trying to solve the problem or why it is important

rather than depending on what you are not controlling Change it to something that you can control.

  1. Ensure that you're redirecting the right kind.

  2. If you do not need data in real time, you can find out from log files. It's easy if you are trying to detect traffic patterns, but are not so useful in real time.

  3. Instead of external redirection, it creates internal redirection, you can track it through the request cycle of your web server.

  4. Set a cookie on external redirection and then look for it in the request. It will not catch people who do not set cookies.

  5. Add path information for redirection or add query parameters as suggested by Cena.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -