/ Zope / Apsis / Pound Mailing List / Archive / 2005 / 2005-05 / Pound rewriting problem

[ << ] [ >> ]

[ "X-forwarded-for" and IIS 5.0 and 6.0 / ... ] [ "X-forwarded-for" and IIS 5.0 and 6.0 / ... ]

Pound rewriting problem
"Timo Hummel" <timo.hummel(at)4fb.de>
2005-05-02 11:42:30 [ FULL ]
Hi list,

I've got a problem where Pound rewrites received data where it shouldn't
rewrite it. We've got a single web server which is configured like this:

Main Website  www.example.com
USA Part        www.example.com/usa/
Entry Page for USA www.example-usa.com

The web server is configured to redirect www.example-usa.com to
www.example.com/usa/ using the following httpd.conf directive:

<VirtualHost *:80>
    ServerName www.example-usa.com
    ServerAlias example-usa.com *.example-usa.com

    Redirect / http://www.example.com/usa/
</virtualHost>

This works perfectly as long as no pound is in the game. When a user goes to
www.example-usa.com, the web server sends back a Location: http://www.example.com/usa

However, when we go via pound, we receive the header Location: http://www.example-usa.com/usa which
results in endless redirects. 

Does anybody know why this happens and how to prevent it?

With best regards
Timo A. Hummel

----
four for business AG

Lilistrasse 83/C  |  63067 Offenbach
phone: +49 69 801082-0  |  fax: +49 69 801082-79
mail: timo.hummel(at)4fb.de  |  web: http://www.4fb.de

AW: Pound rewriting problem
"Timo Hummel" <timo.hummel(at)4fb.de>
2005-05-02 12:05:58 [ FULL ]
> Does anybody know why this happens and how to prevent it?

I investigated the code, and found out that Pound checks if the returned host
is in the list of backends, and thus rewriting the URL. I don't know if this is
correct, however, it doesn't work in my case, as www.example.com and
www.example-usa.com are physically the same machine, but point to different
webs. 

Of course, I could simply modify the pound config (currently it grabs .*),
however, due to the large amount of hosted domains this is not the best way to
go.

with best regards
Timo A. Hummel

----
four for business AG

Lilistrasse 83/C  |  63067 Offenbach
phone: +49 69 801082-0  |  fax: +49 69 801082-79
mail: timo.hummel(at)4fb.de  |  web: http://www.4fb.de

AW: Pound rewriting problem
"Timo Hummel" <timo.hummel(at)4fb.de>
2005-05-02 12:14:50 [ FULL ]
Yet another self-reply:
[...]

Pound knows of the Option "RewriteRedirect" which can turn the behaviour off.
However, I'd suggest that Pound comes with a default configuration file, where
all possible options are listed - that would make it easier for new users.

;)

cheers,
Timo
----
four for business AG

Lilistrasse 83/C  |  63067 Offenbach
phone: +49 69 801082-0  |  fax: +49 69 801082-79
mail: timo.hummel(at)4fb.de  |  web: http://www.4fb.de

MailBoxer