website won't work without www. on 123-reg
For something like this, who your registrar is doesn't matter. Once you have registered the domain, then you also control all subdomains, including www.
Your DNS settings look correct. Based on your cname settings, your www sub-domain should resolve to the same IP address that your non-www domain resolves to. You can test this by pinging both and checking that the IP address matches:
$ ping website.co.uk
64 bytes from myhost (192.168.55.55)
$ ping www.website.co.uk
64 bytes from myhost (192.168.55.55)
Make sure the IP addresses given match (the 192.168.55.55 part in my example). If they don't you have a DNS problem.
Once DNS is set up correctly, you have to make sure the webserver is set up correctly. Again, it sounds like you are trying to do the correct thing and have a redirect in place. You say that you use a "302". I would suggest trying to use a "301 permanent redirect". You can test that it is correct by using the following command and seeing a response similar to the following:
$ curl -s -D - http://www.website.co.uk/
HTTP/1.1 301 Moved Permanently
Location: http://website.co.uk/
Content-Type: text/html; charset=UTF-8
<html><body><p>Moved permanently: <a href="http://website.co.uk/">http://website.co.uk/</a></p></body></html>
Related videos on Youtube
Simon Hayter
Updated on September 18, 2022Comments
-
Simon Hayter over 1 year
I've got a website that works with my custom domain name with the www. but when I type it in without the
www.
it doesn't show up, and I've had customers wondering if my website is down because of this.I'd like my website to work with or without the
www.
whilst still showing the subdomains - eg:www.website.co.uk
andwww.website.co.uk/
contact orwebsite.co.uk
andwebsite.co.uk/contact
but I can't get it to work withoutwww.
I'm not the most clued up person when it comes to DNS and servers and all that, so if you can give it to me in simple terms that would be great.
I currently have my domain with 123-reg and my DNS forwarding is set up as follows:
@ CNAME website.site.com www CNAME website.site.com
I also have web forwarding set up as 302 -
website.site.com
but I think this gets overwritten by the CNAME stuffPlease help me to resolve this as it is so frustrating - but please put it to me in simple terms as otherwise I won't understand!
Thanks so much in advance everyone!!
-
Admin about 11 yearswebmasterworld.com/website_technology/3454188.htm try a search engine "DNS www and non www"
-