-2

id like to get the url of an website, which an website is automatically referring to. For example: When i browse the link "www.example.de" it refers me automatically to "www.example.de/example123/example.php" (This one id like to get)

Unfortunetaly it is not possible to get the second link but using the first link.

Greeting, Geigerkind

  • possible duplicate of [php get url of redirect from source url](http://stackoverflow.com/questions/17472329/php-get-url-of-redirect-from-source-url) – esqew Jun 18 '14 at 14:37
  • Are you asking how to redirect `www.example.de` to `www.example.de/example123/example.php`? – bloodyKnuckles Jun 18 '14 at 14:37
  • That is exactly what i searched, thanks for the advice esqew. I did not find it on my own. Thanks you really saved my day! – user3752974 Jun 18 '14 at 14:56

1 Answers1

-1

Try this out:

$url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

(Sorry haven't got a PHP up to test on)

wildandjam
  • 502
  • 2
  • 7