How to redirect a domain to a subdomain?

0

I have a site that generates sites in real time, each site created is generated a subdomain to access it, for example the operation of wordpress.com >, getting like this: link .

How do I, after hiring a new domain, redirect it to the subdomain that I created in the site generator?

Example:

I created a website and generated the following address: link , after doing this, I went to registro.br and I have registered a new domain called novodominio.com.br and I need to have it when I access it a redirection to the address link but preserving in the address bar the newdomain.com. Do not confuse with 301 redirect.

    
asked by anonymous 15.08.2014 / 07:14

1 answer

3

You can add these lines in the .htaccess file:

RewriteCond %{HTTP_HOST} ^novodominio.com.br
RewriteRule ^(.*) http://nomedousuario.dominio.com.br/$1 [P]

With this code, you will access the contents of http://nomedousuario.dominio.com.br , however the address displayed in the bar will be novodominio.com.br .

Other examples you'll find at LINK

    
15.08.2014 / 14:26