You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alexander Müller <Al...@brz.gv.at> on 2009/09/30 18:32:00 UTC

[users@httpd] mod_rewrite ignoring proxy flag

Hi,

we are having the following RewriteRule entry configured

  RewriteRule ^/(.*)$ https://HOSTNAME/$1 [P]

which generally seems to work, all incoming requests are forwarded to the indicated machine, not as redirect but utilising mod_proxy.

The problem starts to occur when a URL contains a question mark

  /SOMEPATH?/ANOTHERPATH

these URLs do not seem to be proxied through but are actually sent as regular HTTP redirect to the client. I noticed that by separating the question mark - like /SOMEPATH/?/ANOTHERPATH - it doesn't show this behaviour but again works like mod_proxy.

Would anyone have an explanation for this behaviour?


Thanks,
Alexander


---------------------------------------------------------------------
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


Re: [users@httpd] mod_rewrite ignoring proxy flag

Posted by Alexander Müller <Al...@brz.gv.at>.
>>> On 01.10.2009 at 00:26, in message
<7A...@rcbowen.com>, Rich Bowen
<rb...@rcbowen.com> wrote:

> 
> The first thing that comes to mind is that you have a Redirect header  
> being sent by the back-end. Make sure that you have a ProxyPassReverse  
> that matches the initial Proxy request so that redirects are  
> intercepted and fixed up.
> 
> In this case, SOMEPATH? is probably getting redirected to SOMEPATH/ 
> index.html?/ANOTHERPATH, for example.

Thank you very much Rich, this was the crucial hint .... ProxyPassReverse did it.

Thanks again!

Alexander


---------------------------------------------------------------------
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


Re: [users@httpd] mod_rewrite ignoring proxy flag

Posted by Rich Bowen <rb...@rcbowen.com>.
On Sep 30, 2009, at 12:32 , Alexander Müller wrote:

>
> Hi,
>
> we are having the following RewriteRule entry configured
>
>  RewriteRule ^/(.*)$ https://HOSTNAME/$1 [P]
>
> which generally seems to work, all incoming requests are forwarded  
> to the indicated machine, not as redirect but utilising mod_proxy.
>
> The problem starts to occur when a URL contains a question mark
>
>  /SOMEPATH?/ANOTHERPATH
>
> these URLs do not seem to be proxied through but are actually sent  
> as regular HTTP redirect to the client. I noticed that by separating  
> the question mark - like /SOMEPATH/?/ANOTHERPATH - it doesn't show  
> this behaviour but again works like mod_proxy.
>
> Would anyone have an explanation for this behaviour?

The first thing that comes to mind is that you have a Redirect header  
being sent by the back-end. Make sure that you have a ProxyPassReverse  
that matches the initial Proxy request so that redirects are  
intercepted and fixed up.

In this case, SOMEPATH? is probably getting redirected to SOMEPATH/ 
index.html?/ANOTHERPATH, for example.

--
Apache: Nuts To Bolts - Two Day Training @ ApacheCon.
http://us.apachecon.com/c/acus2009/sessions/363
---------------------------------------------------------------------
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