Forum Moderators: phranque

Message Too Old, No Replies

Redirect from Port 80 to 8087 APACHE

mod_rewrite sintaxis for port redirection

         

jmmo1981

10:48 pm on Apr 24, 2008 (gmt 0)

10+ Year Member



Hello,

I need to redirect the requests for a web page www.example.net to the same domain name but with a different port, i mean www.example.net:8087.

This what i already have in http.conf:

#Virtual Host Definition
Listen 8087
NameVirtualHost *:8087
<VirtualHost *:8087>
DocumentRoot "/home/user/www/home"
</VirtualHost>

What should be the syntaxis i should use to redirect the www.example.net to another webpage called www.example.net:8087.

I will really appreciate your help a lot!1

Thanks in advance.

Jorge

jdMorgan

11:11 pm on Apr 24, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just put a Redirect directive in the <VirtualHost> container for port 80 :

Redirect 301 / http://www.example.com:8087/

Jim

jmmo1981

3:13 pm on Apr 25, 2008 (gmt 0)

10+ Year Member



Thank you Jim,

It works....i was just wondering if i want to hide the 8087 port what should i do, i think i should use the proxy but i have never use it.. :(

I will appreciate your help again

Jorge

jdMorgan

5:12 pm on Apr 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you can use a reverse proxy.

The only problem is that all requests on the port 8087 server will be logged as originating from the port 80 server unless you take steps to pass the requesting IP address and/or hostname to the back-end and to log it there using mod_log_config directives.

Jim