You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Bonner <bk...@gmail.com> on 2005/10/31 22:15:27 UTC

[users@httpd] Redirect and ProxyPass or RewriteRule[P]

I'm using ProxyPass and ProxyPassReverse to delegate requests from
Apache 2.0.55 to Tomcat 5.0.30.

Here's what I have:

ProxyPass         /  http://192.168.1.15:8082/internal/
ProxyPassReverse  /  http://192.168.1.15:8082/finternal/

This works fine, however I also want to add a Redirection for a few
URLs that used to exist on the old site into the new one.

I tried doing this by adding:

RedirectMatch ^/grant/evaluation$ /resources/evaluation.html
RedirectMatch ^/emp/int.xyz(.*)$ /employee

The configuration tests ok, but when I try /grant/evaluation, I get an
error from Tomcat that the url:  /internal/grant/evaluation can't be
found.

It looks like the Redirect is not even being handled.

I'm wondering if there was a way to to use RewriteRule fo handle the
redirection and proxying of these requests.  I see that there is a way
to use a [P], but if I use this do I still need to use the ProxyPass? 
How do I handle the ProxyPassReverse?

Thanks,

Brian

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


[users@httpd] Re: Redirect and ProxyPass or RewriteRule[P]

Posted by Brian Bonner <bk...@gmail.com>.
I spoke to soon.  I really need a redirect to occur :(

The url is staying the same in the browser and is not being rewritten
but proxied directly.  I need the URL to change in the browser as well
as the url that is being sent to Tomcat.

Any ideas on how to accomplish this.

If I just remove the [P], the browser doesn't show the new URL.

I've tried adding RedirectMatch as follows:

    RedirectMatch ^/grant/evaluation$
http://%{SERVER_NAME}:%{SERVER_PORT}/resources/evaluation.html

to no avail.

SOS, Help.

Brian


On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> And actually , I forgot the $1 at the end of the last rewrite rule, it
> should have been:
> RewriteRule ^/grant/evaluation$
> http://192.168.1.15:8082/internal/resources/evaluation.html [P]
> RewriteRule ^/emp/int.xyz(.*)$ http://192.168.1.15:8082/internal/employee [P]
> RewriteRule ^/(*.)$ http://192.168.1.15:8082/internal/$1 [P]
>
> Thanks.
>
> On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> > It looks like:  Rewrite will do the trick:
> >
> > RewriteRule ^/grant/evaluation$
> > http://192.168.1.15:8082/internal/resources/evaluation.html [P]
> > RewriteRule ^/emp/int.xyz(.*)$ http://192.168.1.15:8082/internal/employee [P]
> > RewriteRule ^/(*.)$ http://192.168.1.15:8082/internal [P]
> >
> > If anyone has any caveats or comments about this approach, please let
> > me know.  Thanks.
> >
> > Brian
> >
> > On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> > > I'm using ProxyPass and ProxyPassReverse to delegate requests from
> > > Apache 2.0.55 to Tomcat 5.0.30.
> > >
> > > Here's what I have:
> > >
> > > ProxyPass         /  http://192.168.1.15:8082/internal/
> > > ProxyPassReverse  /  http://192.168.1.15:8082/finternal/
> > >
> > > This works fine, however I also want to add a Redirection for a few
> > > URLs that used to exist on the old site into the new one.
> > >
> > > I tried doing this by adding:
> > >
> > > RedirectMatch ^/grant/evaluation$ /resources/evaluation.html
> > > RedirectMatch ^/emp/int.xyz(.*)$ /employee
> > >
> > > The configuration tests ok, but when I try /grant/evaluation, I get an
> > > error from Tomcat that the url:  /internal/grant/evaluation can't be
> > > found.
> > >
> > > It looks like the Redirect is not even being handled.
> > >
> > > I'm wondering if there was a way to to use RewriteRule fo handle the
> > > redirection and proxying of these requests.  I see that there is a way
> > > to use a [P], but if I use this do I still need to use the ProxyPass?
> > > How do I handle the ProxyPassReverse?
> > >
> > > Thanks,
> > >
> > > Brian
> > >
> >
>

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


[users@httpd] Re: Redirect and ProxyPass or RewriteRule[P]

Posted by Brian Bonner <bk...@gmail.com>.
And actually , I forgot the $1 at the end of the last rewrite rule, it
should have been:
RewriteRule ^/grant/evaluation$
http://192.168.1.15:8082/internal/resources/evaluation.html [P]
RewriteRule ^/emp/int.xyz(.*)$ http://192.168.1.15:8082/internal/employee [P]
RewriteRule ^/(*.)$ http://192.168.1.15:8082/internal/$1 [P]

Thanks.

On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> It looks like:  Rewrite will do the trick:
>
> RewriteRule ^/grant/evaluation$
> http://192.168.1.15:8082/internal/resources/evaluation.html [P]
> RewriteRule ^/emp/int.xyz(.*)$ http://192.168.1.15:8082/internal/employee [P]
> RewriteRule ^/(*.)$ http://192.168.1.15:8082/internal [P]
>
> If anyone has any caveats or comments about this approach, please let
> me know.  Thanks.
>
> Brian
>
> On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> > I'm using ProxyPass and ProxyPassReverse to delegate requests from
> > Apache 2.0.55 to Tomcat 5.0.30.
> >
> > Here's what I have:
> >
> > ProxyPass         /  http://192.168.1.15:8082/internal/
> > ProxyPassReverse  /  http://192.168.1.15:8082/finternal/
> >
> > This works fine, however I also want to add a Redirection for a few
> > URLs that used to exist on the old site into the new one.
> >
> > I tried doing this by adding:
> >
> > RedirectMatch ^/grant/evaluation$ /resources/evaluation.html
> > RedirectMatch ^/emp/int.xyz(.*)$ /employee
> >
> > The configuration tests ok, but when I try /grant/evaluation, I get an
> > error from Tomcat that the url:  /internal/grant/evaluation can't be
> > found.
> >
> > It looks like the Redirect is not even being handled.
> >
> > I'm wondering if there was a way to to use RewriteRule fo handle the
> > redirection and proxying of these requests.  I see that there is a way
> > to use a [P], but if I use this do I still need to use the ProxyPass?
> > How do I handle the ProxyPassReverse?
> >
> > Thanks,
> >
> > Brian
> >
>

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


[users@httpd] Re: Redirect and ProxyPass or RewriteRule[P]

Posted by Brian Bonner <bk...@gmail.com>.
It looks like:  Rewrite will do the trick:

RewriteRule ^/grant/evaluation$
http://192.168.1.15:8082/internal/resources/evaluation.html [P]
RewriteRule ^/emp/int.xyz(.*)$ http://192.168.1.15:8082/internal/employee [P]
RewriteRule ^/(*.)$ http://192.168.1.15:8082/internal [P]

If anyone has any caveats or comments about this approach, please let
me know.  Thanks.

Brian

On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> I'm using ProxyPass and ProxyPassReverse to delegate requests from
> Apache 2.0.55 to Tomcat 5.0.30.
>
> Here's what I have:
>
> ProxyPass         /  http://192.168.1.15:8082/internal/
> ProxyPassReverse  /  http://192.168.1.15:8082/finternal/
>
> This works fine, however I also want to add a Redirection for a few
> URLs that used to exist on the old site into the new one.
>
> I tried doing this by adding:
>
> RedirectMatch ^/grant/evaluation$ /resources/evaluation.html
> RedirectMatch ^/emp/int.xyz(.*)$ /employee
>
> The configuration tests ok, but when I try /grant/evaluation, I get an
> error from Tomcat that the url:  /internal/grant/evaluation can't be
> found.
>
> It looks like the Redirect is not even being handled.
>
> I'm wondering if there was a way to to use RewriteRule fo handle the
> redirection and proxying of these requests.  I see that there is a way
> to use a [P], but if I use this do I still need to use the ProxyPass?
> How do I handle the ProxyPassReverse?
>
> Thanks,
>
> Brian
>

---------------------------------------------------------------------
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] Redirect and ProxyPass or RewriteRule[P]

Posted by Brian Bonner <bk...@gmail.com>.
Joshua, thank you.  That did the trick.  I appreciate your help resolving this.

On 10/31/05, Joshua Slive <js...@gmail.com> wrote:
> On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> > I'm using ProxyPass and ProxyPassReverse to delegate requests from
> > Apache 2.0.55 to Tomcat 5.0.30.
> >
> > Here's what I have:
> >
> > ProxyPass         /  http://192.168.1.15:8082/internal/
> > ProxyPassReverse  /  http://192.168.1.15:8082/finternal/
> >
> > This works fine, however I also want to add a Redirection for a few
> > URLs that used to exist on the old site into the new one.
> >
> > I tried doing this by adding:
> >
> > RedirectMatch ^/grant/evaluation$ /resources/evaluation.html
> > RedirectMatch ^/emp/int.xyz(.*)$ /employee
> >
> > The configuration tests ok, but when I try /grant/evaluation, I get an
> > error from Tomcat that the url:  /internal/grant/evaluation can't be
> > found.
>
> BEFORE the existing ProxyPass directive, add
> ProxyPass /grant/evalution !
> ProxyPass /emp/int.xyz !
>
> Joshua
>
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Redirect and ProxyPass or RewriteRule[P]

Posted by Joshua Slive <js...@gmail.com>.
On 10/31/05, Brian Bonner <bk...@gmail.com> wrote:
> I'm using ProxyPass and ProxyPassReverse to delegate requests from
> Apache 2.0.55 to Tomcat 5.0.30.
>
> Here's what I have:
>
> ProxyPass         /  http://192.168.1.15:8082/internal/
> ProxyPassReverse  /  http://192.168.1.15:8082/finternal/
>
> This works fine, however I also want to add a Redirection for a few
> URLs that used to exist on the old site into the new one.
>
> I tried doing this by adding:
>
> RedirectMatch ^/grant/evaluation$ /resources/evaluation.html
> RedirectMatch ^/emp/int.xyz(.*)$ /employee
>
> The configuration tests ok, but when I try /grant/evaluation, I get an
> error from Tomcat that the url:  /internal/grant/evaluation can't be
> found.

BEFORE the existing ProxyPass directive, add
ProxyPass /grant/evalution !
ProxyPass /emp/int.xyz !

Joshua

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