Redirect from "domain.com.br" to "subdomain.xyz.com.br"

3

I'm having a redirection / pointing problem, and I think it's some bad server configuration. I have a VPS (digital ocean) running Ubuntu14 (terminal) with Apache, PHP5, MySql. I have full access to the DNS settings of this VPS and domains (Registro.br).

The problem is as follows: - I own the domain: link in the registry.br - I have the following subdomain in VPS: link

I want the subdomain website to display the subdomain site, type a note, and keep the original domain accessed in the address bar of the browser.

I have already configured the CNAME record in the "registry.br" but without success.

Could anyone help me?

Thank you.

    
asked by anonymous 07.07.2015 / 15:36

3 answers

1

In the apache configuration file, where you set the server VirtualHost (excerpt similar to the code below) from etiquetasribeirao.netshops.com.br , you should create a ServerAlias as below:

<VirtualHost *:80>
  ServerName etiquetasribeirao.netshops.com.br
  ServerAlias etiquetasribeirao.com.br 
...

And in the registry.br you should create a record type A (Host) in the domain etiquetasribeirao.com.br pointing to the IP of your server etiquetasribeirao.netshops.com.br .

    
15.11.2015 / 17:41
0

You will not be able to resolve this with DNS. Even if you accepted that the first name was changed by the second in the browser bar, it is not recommended to make CNAME for a domain. CNAME is for subdomains, eg for a netshops.etiquetribeirao.com redirect to labelsribeirao.netshops.com.br, when there is no other DNS record for the name, and the domain name always has records (SOA, NS , ...)

For a website to keep the name of the bar, but show parts of others, you can use iframe, or server-side proxy (mod_proxy in the case of Apache, according to Adriano Salles comment).

    
12.08.2015 / 22:11
0

Within the scope VirtualHost , add:

ServerAlias etiquetasribeirao.netshops.com.br 

just below servername etiquetasribeirao.com.br .

    
20.08.2015 / 23:21