You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Hugh Williams <hu...@soco.agilent.com> on 2002/04/10 22:38:57 UTC
port redirect question
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
--
Hugh Williams "Rome did not create a great empire by
hugh_williams@agilent.com having meetings...they did it by
Agilent Technologies killing all those who opposed them."
Santa Rosa 2LS-R
(707)-577-4941
---------------------------------------------------------------------
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
Re: port redirect question
Posted by Irmund Thum <it...@it97.dyn.dhs.org>.
Hans Juergen von Lengerke wrote:
> 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 <hu...@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
if you're still stuck with mod_rewrite and want immediate results,
simply use a meta redirect tag with 0 within the head of your main index.html
--
_ ___
| | Irmund Thum
| |
---------------------------------------------------------------------
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
Re: port redirect question
Posted by Hans Juergen von Lengerke <le...@sixt.de>.
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 <hu...@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