0

Let's say I have a redirect rule on the url example.com that redirects to newurl.net. How can I retrieve the url that redirects to newurl.net so I can use it and process it with some details or just print it to a new destination?

Thank you all for your help.

savegramer
  • 21
  • 5
  • You can use headers to add additional information. – Markus Zeller Jan 21 '23 at 10:53
  • You need to pass the old location along when redirecting to the new location somehow, like using a header or query parameter. How to do it depends on how and where you've set up the redirect rule, which you haven't mentioned. – M. Eriksson Jan 21 '23 at 10:54
  • [Does this answer help you?](https://stackoverflow.com/a/28458522/5897602) – Jaquarh Jan 21 '23 at 10:57
  • @markus-zeller Can you show me from a code block how to do it please? – savegramer Jan 21 '23 at 10:57
  • @m-eriksson Can you show me from a code block how to do it please? – savegramer Jan 21 '23 at 10:57
  • Depends on how you do the redirect. You can use headers() in PHP or do it via your webserver like nginx/apache. – Markus Zeller Jan 21 '23 at 11:01
  • For future reference, to get help with specifics, you need to share specifics. This time you were in luck that someone guessed correctly, but don't count on it next time you ask a question. – M. Eriksson Jan 21 '23 at 11:11
  • 1
    @m-eriksson Next time I will give more information so you can help me. Thank you for your patience with me. – savegramer Jan 21 '23 at 11:13

0 Answers0