I'm trying to redirect `www.example.com` to `example.com` This is my nginx rewrite rule:
server {
listen 80;
server_name www.upinbangalore.com;
return 301 http://upinbangalore.com$request_uri;
}
server {
listen 80;
server_name upinbangalore.com;
[...]
The redirection for **www to non-www** is working fine. But the problem is the other sub domain `mail.example.com` which I've set **CNAME records** to the mail server is also getting redirected to `example.com`
How could I avoid this?
This is my DNS setup in Linode.
A/AAAA Records
Hostname IP Address TTL Options
xxx.xxx.xxx.xxx Default Edit | Remove
www xxx.xxx.xxx.xxx Default Edit | Remove
CNAME Records
Hostname Aliases to TTL Options
mail go.domains.live.com Default Edit | Remove
Thanks!