This one will be a short but important one, especially if you plan to start a web project or if you currently have one.
Lately I’ve been working on a really nice project and I’ve been assigned (read assigned myself) to set up the web server (apache, version control software, project manager and so on…). In my swing I also set up the domains and I figured a couple of things to save time later, especially for SEO. But let’s cut to the chase, shall we?
As I was configuring subdomains for private parts, I stumbled upon the case of the “www” subdomain. Let me explain, most of the website running on the web have a web address that looks either like this “http://www.example.com/” or “http://example.com” and sometimes both are available and display the same content (which is bad btw). Now one thing you should now if you’re not familiar w/ domains is that in reality the “www” before a website address is a subdomain of the main domain he is in front of, a subdomain either points to a different server or a specific place on the same server (that can be the same place as the main domain) as the main domain. Well, you might be thinking right now, okay but what’s your point?
My point is that this “www” subdomain isn’t really “natural” for a particular domain, but heck it’s so widely used on the Internet you got to create that subdomain cause you don’t want your users to stumble upon on a 404 page when loading your web app/service w/ “www” in front of your domain. But this causes another problem when you set both your domain and your domain w/ the “www” subdomain to display the same page you open a door for search engine to index your site twice and this is really bad for SEO. So, what are the best practices there?
It’s simple, you should always set a permanent redirection either from www to non-www or non-www to www. But there’s also one thing to keep in mind when doing domain redirections shorter is better. With that in mind, IMO you should always opt for the first solution (www to non-www).
That’s it, if you want some more informations or react to this post please feel free to write a comment.



