Rewrite to another Port

This is a discussion on Rewrite to another Port within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, can somebody tell me how to make a ReWrite Rule for changing port ? Example: User calls sub.domain.com ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-21-2003
Fabian Eschrich
 
Posts: n/a
Default Rewrite to another Port

Hi,

can somebody tell me how to make a ReWrite Rule
for changing port ?

Example:

User calls sub.domain.com
and rewrite should go to sub.domain.com:82 ?

Thanks for your help.

Bye, Fabian


  #2 (permalink)  
Old 07-24-2003
Fabian Eschrich
 
Posts: n/a
Default Re: Rewrite to another Port

can somebody help me ?


  #3 (permalink)  
Old 07-24-2003
Davide Bianchi
 
Posts: n/a
Default Re: Rewrite to another Port

Fabian Eschrich <f.eschrich@futris.net> wrote:
> User calls sub.domain.com
> and rewrite should go to sub.domain.com:82 ?


You can use a Redirect in a VirtualHost directive such as

<VirtualHost *>
Redirect / sub.domain.com:82
ServerName sub.domain.com
</VirtualHost>

Davide
  #4 (permalink)  
Old 07-24-2003
Fabian Eschrich
 
Posts: n/a
Default Re: Rewrite to another Port

Hi Davide,

i know this way, but I want to use a wildcard way,
so i don't have to know each subdomain.

Do you understand me ?

I want apache to take the domain and subdomain
the user entered and redirect it to port 82


Thanks for your help.

Bye, Fabian


  #5 (permalink)  
Old 07-24-2003
Davide Bianchi
 
Posts: n/a
Default Re: Rewrite to another Port

Fabian Eschrich <f.eschrich@futris.net> wrote:
> i know this way, but I want to use a wildcard way,
> so i don't have to know each subdomain.
> Do you understand me ?


Hemmm... Not completely, if you user type "http://www.somedomain.com" in
his browser there is a DNS that resolve the name into your server, if
you want EVERYTHING routed to port 82, you can use the Redirect directive
in the "normal" configuration (outside virtual hosts) and that's it,
but then the question is, why you want it redirected to port 82??

If you have two Web servers on one single machine, and you want to
use Apache as "proxy" to manage both, use the ProxyPass directive of
mod_proxy, is way effective.

Please, explain a little bit your problem and not your solution.

Davide
  #6 (permalink)  
Old 07-24-2003
Davide Bianchi
 
Posts: n/a
Default Re: Rewrite to another Port

Fabian Eschrich <f.eschrich@futris.net> wrote:
> I want to put some Subdomains of a domain hosted on server 1 to server 2.


Well, this is quite weird, I saw things like this done with IIS and
Apache on the same machine, never between two Apaches, but..

I think that, if you really want to use the mod_rewrite, it should be
something like

RewriteRule ^http://subdmain/(.*)$ http://subdomain:82/$1 [P]

But I'm no rewrite guru, so test it...

Davide
  #7 (permalink)  
Old 07-29-2003
Fabian Eschrich
 
Posts: n/a
Default Re: Rewrite to another Port

Hi Davide,

thank you very much.

I think this is what I mean, but it does not work.

Do you have another idea ?

Thank you very much,

Bye, Fabian


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:51 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0