Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have three websites hosted (example1.com, example2.com, example3.com) on a server. There is a page (test.php) on example1.com with just code below inside it:

<?php
  header('Location:http://example2.com/a.php');
?>

When I browse test.php it goes to http://example1.com/a.php . it doesn't understand it is another domain url, it tried to find the page on itself.

but when I put http://google.com instead of example2.com/a.php it works correct. I really get confused.

What is the problem ? Should I set some configuration on the server?

( I am administrator of the hosting server ). Ps. The server is behind a pound server.

Here's the Firebug Net output for example1.com/test.php

Response Headers: 

HTTP/1.1 302 Found
Date: Tue, 09 Oct 2012 09:03:34 GMT
Server: Apache/2.2.16 (Debian)
Location: http://example1.com/a.php
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 21
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8

Request Headers:

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection  keep-alive
Cookie  mycookie
Host    example1.com
User-Agent  Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1
share|improve this question
    
Are you sending a 3xx status code? See en.wikipedia.org/wiki/HTTP_location –  Colin 't Hart Oct 9 '12 at 8:04
    
yes, 302 status is logged in access_log. –  hd01 Oct 9 '12 at 8:14
    
Can you show the complete HTTP headers (use wget, curl, firebug, etc) –  Colin 't Hart Oct 9 '12 at 8:27
    
There should be a space before the http. What happens if you put 'example2.com/a.php'; into your browser? –  symcbean Oct 9 '12 at 8:34
    
@symcbean : if I browse example2.com/a.php it works as a regular php file. –  hd01 Oct 9 '12 at 8:52
show 3 more comments

1 Answer 1

the problem is solved. it was because of pound server configuration. 'RewriteLocation' entry in pound server configuration must be set to 2 to this server doesn't change the redirect location.

anyway, thank you for answering.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.