You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Gunter Verbocht <gu...@verbocht.be> on 2003/01/23 18:57:13 UTC

RE: [users@httpd] mod-rewrite question

Hi,

When I was trying to get it all to work, I had the same problem that 
   RewriteCond %{REQUEST_URI} ^/students.asp(.*)
   RewriteRule  ^/(.*) http://www.bar.com/$1 [P]
returned a 403 error. The reason is that you are using proxy (look at
the [P]) but you have not installed the proxy mod. Add to httpd.conf the
load proxy module and add proxy module. Then these rules will work.

Regards,

Gunter Verbocht

-----Original Message-----
From: Jack Elliston [mailto:elliston@benedictine.edu] 
Sent: donderdag 23 januari 2003 19:01
To: users@httpd.apache.org
Subject: [users@httpd] mod-rewrite question

This question is similar to the recent thread related to mod-rewrite and
keeping the original URL.

Based on reading the other thread it sounds like I need to use mod-proxy
but
let me ask anyway to confirm.

Here is what I want

Local site: www.foo.com
Other site: www.bar.com

I want all traffic for www.foo.com with "students.asp" in the url to get
the
content for those pages from www.bar.com with everything in the path
simply
passed on.  I prefer to deliver to the client the
www.foo.com/students.asp?xxxx rather than the
www.bar.com/students.asp?xxxx

I have mod-rewrite installed and I am doing some of this sort of thing
locally but not across domains/machines.

My current rewrite rule:

   RewriteCond %{REQUEST_URI} ^/students.asp(.*)
   RewriteRule  ^/(.*) http://www.bar.com/$1 [P]

The above generates a 403 Forbidden error while a "[R]" or no option all
redirect and display the www.bar.com version of the URL.

Is this doable in mod-rewrite?  I potentially will have a couple of more
complex scenarios if I get this working.

Thanks for your help,
----------------------------------------
Jack Elliston
Director, Computing and Network Services
Benedictine College
(913) 360-7372


---------------------------------------------------------------------
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] mod-rewrite question

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 23 Jan 2003, Jack Elliston wrote:

> I believe they are relative URL's but I am not certain if the path on the
> remote is the document root for the virtual domain (IIS server) or the file
> system root.  I don't have access to the "www.bar.com" server even though it
> will be our content.

Filesystem paths can't be used on webpages.

You can see what is actually being used just by looking at the source of
the webpage in your browser.

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


RE: [users@httpd] mod-rewrite question

Posted by Jack Elliston <el...@benedictine.edu>.
I believe they are relative URL's but I am not certain if the path on the
remote is the document root for the virtual domain (IIS server) or the file
system root.  I don't have access to the "www.bar.com" server even though it
will be our content.

Thanks for the help anyway.

Jack

-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca]
Sent: Thursday, January 23, 2003 3:47 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] mod-rewrite question



On Thu, 23 Jan 2003, Jack Elliston wrote:

> Still does not work.
>
> Even with the "ProxyPassReverse / http://www.bar.com/" value it still does
> not get the css (Netscape errors and IE fails to get pictures, etc.)
>
> Thanks for the idea.  What additional info would help?

Sorry, I wasn't reading carefully.  ProxyPassReverse only rewrites certain
HTTP headers.  It will not touch the html.  You need to use relative URLs.

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] mod-rewrite question

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 23 Jan 2003, Jack Elliston wrote:

> Still does not work.
>
> Even with the "ProxyPassReverse / http://www.bar.com/" value it still does
> not get the css (Netscape errors and IE fails to get pictures, etc.)
>
> Thanks for the idea.  What additional info would help?

Sorry, I wasn't reading carefully.  ProxyPassReverse only rewrites certain
HTTP headers.  It will not touch the html.  You need to use relative URLs.

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


RE: [users@httpd] mod-rewrite question

Posted by Jack Elliston <el...@benedictine.edu>.
Still does not work.

Even with the "ProxyPassReverse / http://www.bar.com/" value it still does
not get the css (Netscape errors and IE fails to get pictures, etc.)

Thanks for the idea.  What additional info would help?

Jack

-----Original Message-----
From: Joshua Slive [mailto:joshua@slive.ca]
Sent: Thursday, January 23, 2003 3:07 PM
To: users@httpd.apache.org
Subject: RE: [users@httpd] mod-rewrite question



On Thu, 23 Jan 2003, Jack Elliston wrote:

> Thanks for the reply.
>
> I have enabled the proxy mod but I still have a problem which may require
> the use of the full features of mod-proxy.
>
> I get a "foo.css" not found error.
>
> It looks like I need the "ProxyPassReverse".
>
> Is there a way to use the two together?
>

Certainly.
ProxyPassReverse / http://www.bar.com/
will probably do the trick for your example.

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] mod-rewrite question

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 23 Jan 2003, Jack Elliston wrote:

> Thanks for the reply.
>
> I have enabled the proxy mod but I still have a problem which may require
> the use of the full features of mod-proxy.
>
> I get a "foo.css" not found error.
>
> It looks like I need the "ProxyPassReverse".
>
> Is there a way to use the two together?
>

Certainly.
ProxyPassReverse / http://www.bar.com/
will probably do the trick for your example.

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


RE: [users@httpd] mod-rewrite question

Posted by Jack Elliston <el...@benedictine.edu>.
Thanks for the reply.

I have enabled the proxy mod but I still have a problem which may require
the use of the full features of mod-proxy.

I get a "foo.css" not found error.

It looks like I need the "ProxyPassReverse".

Is there a way to use the two together?

Jack

-----Original Message-----
From: Gunter Verbocht [mailto:gunter@verbocht.be]
Sent: Thursday, January 23, 2003 11:57 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] mod-rewrite question


Hi,

When I was trying to get it all to work, I had the same problem that
   RewriteCond %{REQUEST_URI} ^/students.asp(.*)
   RewriteRule  ^/(.*) http://www.bar.com/$1 [P]
returned a 403 error. The reason is that you are using proxy (look at
the [P]) but you have not installed the proxy mod. Add to httpd.conf the
load proxy module and add proxy module. Then these rules will work.

Regards,

Gunter Verbocht

-----Original Message-----
From: Jack Elliston [mailto:elliston@benedictine.edu]
Sent: donderdag 23 januari 2003 19:01
To: users@httpd.apache.org
Subject: [users@httpd] mod-rewrite question

This question is similar to the recent thread related to mod-rewrite and
keeping the original URL.

Based on reading the other thread it sounds like I need to use mod-proxy
but
let me ask anyway to confirm.

Here is what I want

Local site: www.foo.com
Other site: www.bar.com

I want all traffic for www.foo.com with "students.asp" in the url to get
the
content for those pages from www.bar.com with everything in the path
simply
passed on.  I prefer to deliver to the client the
www.foo.com/students.asp?xxxx rather than the
www.bar.com/students.asp?xxxx

I have mod-rewrite installed and I am doing some of this sort of thing
locally but not across domains/machines.

My current rewrite rule:

   RewriteCond %{REQUEST_URI} ^/students.asp(.*)
   RewriteRule  ^/(.*) http://www.bar.com/$1 [P]

The above generates a 403 Forbidden error while a "[R]" or no option all
redirect and display the www.bar.com version of the URL.

Is this doable in mod-rewrite?  I potentially will have a couple of more
complex scenarios if I get this working.

Thanks for your help,
----------------------------------------
Jack Elliston
Director, Computing and Network Services
Benedictine College
(913) 360-7372


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


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