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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |