You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by ph...@free.fr on 2009/10/29 10:35:16 UTC

Re: [users@httpd] Strange redirect issue [solved]

The issue was due to a commented-out directive in the w directory's .htaccess file:


  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  RewriteBase /w


Uncommenting the RewriteBase directive above solved the problem

p


----- Mail Original -----
De: phiroc@free.fr
À: users@httpd.apache.org
Envoyé: Jeudi 29 Octobre 2009 10:22:38 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: [users@httpd] Strange redirect issue

Hi,

the network administrator at my company has created a domain name, called intranetalias.company.com,
which is an alias of a domain name, which I will call intranet.company.com in this thread.

When I curl -IL (display header and follow redirect) intranetalias.company.com/w, 
the following lines are displayed:

bash-3.2$ curl -IL intranetalias.company.com/w
HTTP/1.1 301 Moved Permanently
Date: Thu, 29 Oct 2009 08:39:00 GMT
Server: Apache/2.063 (Unix)
Location: http://intranet.company.com/w/
...

HTTP/1.1 302 Found
Date: Thu, 29 Oct 2009 08:39:00 GMT
Server: Apache/2.063 (Unix)
X-Powered-By: PHP/5.3.0
Location: http://intranet.company.com/w/install.php
Cache-Control: no-cache
...


Apache redirects curl to intranet.company.com.


I have created a similar environment on a test server. However, Apache seems to behave differently: 

bash-3.2$ curl -IL test.company.com/drupal6
[ test.company.com is an alias of mydevelopmentsite.company.com ]
HTTP/1.1 301 Moved Permanently
Date: Thu, 29 Oct 2009 08:41:30 GMT
Server: Apache/2.2.8
Location: http://test.company.com/drupal6/
...

HTTP/1.1 200 OK
Date: Thu, 29 Oct 2009 08:52:45 GMT
Server: Apache/2.2.8 (Unix) ...
X-Powered-By: PHP/5.2....
Set-Cookie: SESS7c5f225c10fa9a20232394a61e7275f2=5c578a0b9e7274a72de76264189a605c;
 expires=Sat, 21-Nov-2009 12:26:05 GMT; path=/; domain=.test.company.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Thu, 29 Oct 2009 08:52:45 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8


In this case, Apache redirects curl to the alias domain name, test.company.com
instead of the real domain name (mydevelopmentsite.company.com).

Why are the two Apaches behaving differently?

Please note that there aren't any redirect or URL rewriting directives in the Apache's 
respective configuration files which could cause that behavior.

Any help with this issue would be much appreciated.


p

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org