I have a website that is a small, one page html/css/js site. I want the viewers to be able to view the same site whether they are coming from www.domain.com or just domain.com, without redirection. Is this possible?
2 Answers
What web server software are you using? IIS?
Have two A records, "www.yoursite.com" and "yoursite.com" point to same IP, and set the bindings on the site in your server to take in both request.
-
3+1 In Apache, you'll want to edit the
ServerAlias
to have www.example.com and example.com; is IIS under the Advanced settings for the website, you'll see the host headers; add both www. and . there. As for DNS, I generally set www. as a CNAME to the A record example.com for sheer laziness if I have to change it. Jun 24, 2010 at 19:34
Is there any reason why you can't just redirect DNS? That is, set up two address records that point at the server and the client will get the same site.