You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by vivek aggarwal <vi...@yahoo.co.in> on 2012/10/13 19:44:17 UTC

[users@httpd] Apache Query- RewriteRule

Hi All,
 
I h've observed that i am able to redirect from apache to Tomcat Application without using  "ProxyPass" attribute.
 
I just used  the following rewrite rule in place of     "ProxyPass /abc  http://localhost:8080/kdah " 
 
*************************************
RewriteRule ^/$ http://localhost:8080/kdah
 
*************************************
Does that mean we can use rewrite rules in case we need to do redirect to tomcat or other applications in place of "ProxyPass" ????
 
Please help me in understanding the basic difference between rewrite rule & Proxy Pass property with regards to redirection 
 
thanks in advance for your help
vicky

Re: [users@httpd] Apache Query- RewriteRule

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Sat, Oct 13, 2012 at 1:44 PM, vivek aggarwal <
vicky007aggarwal@yahoo.co.in> wrote:

> Hi All,
>
> I h've observed that i am able to redirect from apache to Tomcat
> Application without using  "ProxyPass" attribute.
>
> I just used  the following rewrite rule in place of     "ProxyPass /abc
> http://localhost:8080/kdah "
>
> *************************************
> RewriteRule ^/$ http://localhost:8080/kdah
>
> *************************************
> Does that mean we can *use rewrite rules* in case we need to do redirect
> to tomcat or other applications *in place of "ProxyPass" ????*
>
> Please help me in understanding the basic difference *between rewrite
> rule & Proxy Pass property with regards to redirection*
>

Your rewrite rule (as copied in your message) causes the request not to be
proxied through Apache at all, it tells your browser to directly access
localhost:8080.
The rewriter does have a proxy option if you specify the [P] flag at the
end of the rewrite rule.
See this old discussion on this list:
http://mail-archives.apache.org/mod_mbox/httpd-users/200409.mbox/%3CFAB6A3A2CC5BDB448DADFA1C8C0752965F7578@SOMEXEVS001.ex.ordersx.org%3E