Home  >  Article  >  Backend Development  >  How to get the redirect source in PHP?

How to get the redirect source in PHP?

WBOY
WBOYOriginal
2016-10-22 00:14:101575browse

How to get the redirect source in PHP?
For example, www.a.com redirects to www.b.com through header location. How does www.b.com obtain the redirection source to determine whether this visit is redirected from www.a.com?

Reply content:

How to get the redirect source in PHP?
For example, www.a.com redirects to www.b.com through header location. How does www.b.com obtain the redirection source to determine whether this visit is redirected from www.a.com?

Can php get referer from header?

js has this referer, which is the access source. The author can search it on Baidu, and then you can use this

Try to get it via $_SERVER['HTTP_REFERER']

The answer is that it cannot be obtained.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn