httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Juergen von Lengerke <lenger...@sixt.de>
Subject Re: port redirect question
Date Thu, 11 Apr 2002 07:52:16 GMT
Depends what you mean with 'to be sent to'. In any case you will need
mod_rewrite and two virtual hosts, one for foo.bar.com:80 and one for
foo.bar.com:8888.  Assuming you don't want any other virtual hosts on
the machine you could do:

  Listen 80
  Listen 8888

  <VirtualHost _default_:80>
    ServerName foo.bar.com
    ____ here goes your rewrite rule ____
  </VirtualHost>

  <VirtualHost _default_:8888>
    ServerName foo.bar.com
  </VirtualHost>

Now, if 'to be sent to' means the browser should be redirected to the
8888 server you'd put in your rewrite rule:

    RewriteRule ^(.*)$ http://foo.bar.com:8888$1 [R]

If you want the request to be proxied internally (ie. the browser
shouldn't be aware of the 8888 server) you'd do:

    RewriteRule ^(.*)$ http://foo.bar.com:8888$1 [P]
    ProxyPassReverse / http://foo.bar.com:8888

Check the documentation on Rewrite and VirtualHosts.

Good Luck, Hans


Hugh Williams <hughw@soco.agilent.com> on Apr 10, 2002:

> Hi;
>
> Well, I *thought* I knew what I was doing...
>
> I want to cause all visits to
>
> http://foo.bar.com/<stuff>
>
> to be sent to
>
> http://foo.bar.com:8888/<stuff>
>
> I've tried various combinations of virtual hosts and/or rewrite
> directives, but the results have been less than perfect.  Does someone
> have a simple recipe t oaccomplish this transformation consistently?
>
> Thanks,
>
> hugh


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message