Newer
Older

To www or not to www?

Date: 2024-12-02 11:47
Tags: this-web-server

Via indieweb I found there is (or was) a no www. movement.

This is wrong. It's true that a domain which only holds a website has no reason for a www. prefix, but there are more things on the internet than the Web. You can have a WWW server at foobar.com, but if you also want an IRC server at foobar.com, they have to have the same IP address. You don't want to limit yourself like that, so you put the IRC server at irc.foobar.com. You could call it something else - have a WWW server at foobar.com and an IRC server at barbaz.com - but that's silly.

The CNAME problem is somehow similar to this. If you want to use a CNAME record for your web server (delegating foobar.com to myhostingprovider.net), it delegates not only foobar.com but also every other domain ending in foobar.com. If your hosting provider doesn't also run your IRC server, you can't do this.

SRV records would change this situation, as your domain could specify a different IP address per service. However, SRV records are not used for HTTP(S).

So basically, not using www. is not futureproof.

It's easy enough to host the website at both foobar.com and www.foobar.com until there's a reason not to, but search engines like Google prefer each page to have a single "canonical" URL. Because no-www is not futureproof, it seems obvious the canonical URL should have the www. Therefore, I am now enforcing www on this site.