For an example, link A to "www.abc.com/test.php?#if eregi ('ABC', $ _ SERVER ['http _ referer']) | strpos ($ _ SERVER ['http _ host'], 'ABC ')! = Fal: a question about redirection in PHP
For example, link A to "www.abc.com/test.php"
Determine if eregi ('ABC', $ _ SERVER ['http _ referer']) | strpos ($ _ SERVER ['http _ host'], 'ABC ')! = False
Go to www.def.com/test.php.
The local test is successful, but the two URLs are repeatedly redirected on the SERVER. then, the strpos ($ _ SERVER ['http _ host'], 'ABC') is removed ')! = False.
Why?
In addition, the redirection method I use is
Echo' '; Exit;
Others are normal, but the Apple browser does not seem to work .. ..
Is there a better way? I have tried a lot before, but it seems to have something to do with browsers, for example, to output headers and javascript?
------ Solution --------------------
You can
Header ("location: www.def.com/test.php ");
------ Solution --------------------
Abc and def are just different domain names, and the directories and files to which they are directed are the same.
This is the key. The operation is actually the same file.
------ Solution --------------------
I don't know if it is the same file ~~ Solution ~~
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service