I have bought multiple domain names for my website. Right now, I redirect these parked domains (the domains pointing to my nginx ipaddress) like this:
server {
server_name example.com www.example;
rewrite ^(.*) http://example.co.uk$1 permanent;
}
Now, I have over 5 or 6 parked domains all pointing to this ipaddress (1 site). So if I have multiple parked domain for the same site, is my only option is to write a really lengthy server_name like this?
server {
server_name example.com www.example example.org www.example.org example.net www.example.net examples.com www.examples.com examples.org www.examples.org examples.net www.examples.net;
rewrite ^(.*) http://example.co.uk$1 permanent;
}
The above doesnt look right to me. But my question is, is this how its done? I mean, if I have many parked domains, I just a add keep adding to my lengthy line in my Nginx config's server block and that should do it with no problem?
Can someone please clarify this for me please...