Redirect "dominio.com.br" to "Subdominio.xyz.com.br"

Asked

Viewed 1,056 times

3

I have a redirect/pointing problem and I believe it is some incorrect 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 the domains (Registro.br).

The problem is this: - I own the domain: http://etiquetasribeirao.com.br in the register.br - I have the following domain in VPS: http://etiquetasribeirao.netshops.com.br

I want when accessing the domain to be displayed the website of the domain, type a note, keeping in the address bar of the browser, the original domain accessed.

I have already set up in "record.br" the CNAME record but without success.

Could someone help me?

Thank you.

  • Good afternoon, You can use apache’s mod_proxy to do this. Already know this apache module?

  • I advise you to remove the real domain from your post. It goes that by posting code here, it becomes public some useful information to someone malicious...

3 answers

1

In the apache settings file, where you configured the server the VirtualHost (similar to the code below) etiquetasribeirao.netshops.com.br, you must create a ServerAlias as is below:

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

And in the.br record you must create a type A (Host) record in the domain etiquetasribeirao.com.br pointing to your server’s IP etiquetasribeirao.netshops.com.br.

0

You won’t be able to solve this with DNS. Even if you accept that the first name is changed to the second in the browser bar, it is not recommended to make a domain name CNAME. CNAME is for subdomains, e.g. for a netshops.etiquetasribeirao.com.br redirect to tagsribeirao.netshops.com.br, when there is no other DNS record for the name, and the domain top name always has records (SOA, NS, ...)

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

0

Within the scope VirtualHost, add:

ServerAlias etiquetasribeirao.netshops.com.br 

just below the servername etiquetasribeirao.com.br.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.