Redirect domain / subdomain to IP with port


I have a server where I host all my webs, it is a private server and I have a fixed IP address.

The problem is that I have a single IP, port 80 goes to a server and 8082 to the server that we have to host the webs, the other is to other web topics.

Now I want to be able to redirect a domain to the IP

My doubt is that, after researching a lot about how to do it, I can not make the configuration.

In principle in the domain, I should put my public IP with the port and then on the server a htaccess so that it redirects according to the domain from which it is accessed, right?

Any ideas?

asked by Diego 28.11.2016 в 09:32

1 answer


You can not use ProxyPass in .htaccess . The documentation says that it is only applicable to the context:


Context: server config, virtual host, directory

Therefore, what you should do is create a virtual host, to be able to redirect to the IP

<VirtualHost *:80>

    ProxyPass /
    ProxyPassReverse /


answered by 28.11.2016 / 10:48