WordPress Canonical URLs: Redirect WWW to Non-WWW Blog URLs and Vice Versa

By: Sophia Lucero | February 18, 2008 | Leave a Comment

Perhaps one of the number one tips expert bloggers will give newbies, particularly in the realm of search engine optimization, is to use consistent URL formats. Usually a website address can be accessed with or without the WWW. For example, http://www.wordpressphilippines.org/ and http://wordpressphilippines.org/ are valid URLs for this website but you don’t see a WWW in the address bar, right? That’s because we’ve redirected the WWW URL to the non-WWW URL.

The problem with having both a WWW and a non-WWW URL for your website is that Google and other search engines will assume . In the past, you could only fix this by adding a few lines of code in the your .htaccess file, or by telling Google they point to the same website. But if you’re running the latest version of WordPress (2.3), it automatically does that for you! Yes, just specify in the General Options page of the administration panel what your blog URL should look like. If you add a WWW, it will redirect all non-WWW URLs, and vice versa.

The truth is, there is more to URL canonicalization than I’ve mentioned here, but this is another proof of how WordPress has grown and incorporated these neat little features. It’s also a pretty good introduction to how the world of Search Engine Optimization works.

So now the question is if you prefer having WWW in your URLs or not! I personally prefer removing the WWW because it’s shorter and neater that way. How about you? What does your blog URL look like?

Related Posts

Tags: , , , ,

2 Comments

  1. Jeff Starr Said,

    Yes, canonical URLs are automatic for WordPress 2.3+, however, the www-redirection is happening at the PHP level, which is slower and requires more server resources than if it were happening directly through Apache. This built-in PHP redirection is perhaps good for users of WordPress 2.3 who don’t have access to httpd.conf/htaccess, but for users of older versions of WordPress, or for those of us who prefer to handle URL redirection via Apache, there is a much better solution for permalink canonicalization. Incidentally, I prefer the cleaner, non-www versions of my URLs! ;)

  2. Sophia Lucero Said,

    Yeah, features like these are great for those who don’t want to tinker too much with the WordPress backend. I’d like to think people should’ve upgraded to 2.3 by now…it’ll be hard playing catch up once 2.5 arrives!

RSS feed for comments on this post · TrackBack URI

Leave a Reply