I am using file_get_contents() function to get a page source. When I am trying to get the source of http://example.com, which is internally redirected to http://example-new.com. Here I am getting the source of second URL. Is there any solutions to get second URL to identify to which URL it is redirected to.
Asked
Active
Viewed 241 times
0
-
i don't understand the question. some code will help too. – kennypu May 05 '14 at 07:55
-
its 301 redirect http://en.wikipedia.org/wiki/HTTP_301 – Abhik Chakraborty May 05 '14 at 07:56
-
2http://stackoverflow.com/questions/4323985/how-to-get-the-real-url-after-file-get-contents-if-redirection-happens – Abhik Chakraborty May 05 '14 at 07:57
1 Answers
-1
Just make request, wait for 200 and check url. I would recommend reading about curl.

masahuku
- 184
- 6