You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Donald Raikes <do...@draikes.com> on 2004/10/12 21:05:53 UTC

[users@httpd] redirecting with apache 1.3



------------------------------
I am running an apache 1.3 server on a sunos 4 box.
Also on that box I have Oracle's oc4j webserver running on port 8888.

I have 2 dns entries for the box
address1, and address2.
When someone accesses address1, I want it to be handled by the default
virtualhost of my apache server.
When someone accesses address2, I want my second virtual host to be
accessed, but I want to redirect all requests to their associated pages on
the oc4j server.

I am a little unclear about how to get this to work.
If I use:
<virtualhost *>
servername address2
redirect address2 192.168.1.100:8888/home.html
redirectmatch (.*)\*.html 192.168.1.100:8888/$1.html
</virtualhost>

Will that direct
http://www.address2 to 192.168.1.100/home.html
and

http://www.address2/test.html to 192.168.1.100:8888/test.html?



---------------------------------------------------------------------
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] redirecting with apache 1.3

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 12 Oct 2004 12:05:53 -0700 (MST), Donald Raikes <do...@draikes.com> wrote:
> <virtualhost *>
> servername address2
> redirect address2 192.168.1.100:8888/home.html
> redirectmatch (.*)\*.html 192.168.1.100:8888/$1.html
> </virtualhost>
> 
> Will that direct
> http://www.address2 to 192.168.1.100/home.html
> and
> 
> http://www.address2/test.html to 192.168.1.100:8888/test.html?

No.  Redirect takes only a URL-path (the part after the host/port),
not a full URL.  So you probably want something more like
RedirectMatch ^/$ http://192.168.1.......
RedirectMatch (.*)\.html http://192.168.....

But the fact that you are using non-routable IP addresses is a little
worying.  You do realize that Redirect(Match) will ask the client to
refetch the page at the new address?  If you want the server to fetch
the page and return it to the client, you need to look at ProxyPass or
the  [P] flag to RewriteRule.

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