Reputation: 599
I'm having a strange problem here and can't figure the cause. I have a php-script on an nginx server which triggers a redirect to a different (sub)domain on the same server:
For instance: foo.domain.com/redirect.php header("Status:301"); header("location:http://www.domain.com/new_url/");
The result is that I'm getting redirected to: foo.domain.com/new_url
The domain doesn't change at all although my response headers look fine .
Any ideas?
Upvotes: 1
Views: 1823
Reputation: 599
Ok, I finally found the cause for my troubles. Neither Nginx, nor PHP caused the issues. My webservers are behind a loadbalancer running with Pound.
Pound has a feature to rewrite domains inside header redirects (enabled by default). We now turned this feature off and all redirects finally work as expected!
Upvotes: 1
Reputation: 6832
Check your containing your site in an iframe,
Some hosts can do this if its free hosting, all so some domains setup allows the site to be contained in an iframe witch would cause the properly your describing
Upvotes: 0