Redirect Subdomain to another server

1

I am using cPanel and can redirect the subdomain exemplo.dominio.com.br to another server using registry A and IP of the new server, but how do I make this subdomain to be accessible also using www or without www?

Would it be in the redirect or htaccess settings of the new server?

    
asked by anonymous 03.02.2015 / 21:11

1 answer

1

I do not know CPanel very well, but I know you can do this with www and without www changing your vhost, pointing vhost with www and without www for the same folder, for example:

<VirtualHost *:80>
    DocumentRoot /var/www/dominio.com.br
    ServerName www.dominio.com.br
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /var/www/dominio.com.br
    ServerName dominio.com.br
</VirtualHost>
    
04.02.2015 / 02:22