If you’re running a website, chances are you may know about the WWW or No WWW controversy.
Some say that routing your URL to be accessible by WWW is the best way to go – some say the WWW is implied. Do you regularly type in the WWW when you access a website?
If you think it’s implied and possibly a little redundant, you’re not alone. There’s an entire movement of people out there who want to completely do away with the WWW, and are setting up their servers to do a redirect to their domain name without the WWW. They’re hoping this will dissuade WWW users from bothering to type in the prefix.
What About SEO?
There are differing standpoints on whether or not including the WWW prefix disrupts your SEO. Some say that Google will bump you up if your site can be accessed using both WWW, and without the prefix. Some want to do away with WWW entirely. Some only want to use WWW.
Whatever your flavor, the best way to figure out which is going to work for your site is testing. If your site has a ton of visitors and great SEO indexing, it’s probably best to leave the site alone.
There’s tons of info out there about how to do a 301 redirect using your .htaccess file. If you’re using WordPress, you’ll unfortunately find it a little difficult to get your blog not to redirect for either WWW or non-WWW. Meaning, that if you want your users to get to your site using both www.example.com and example.com without a redirect, you’re going to have to get into your code.
functions.php
Your theme functions file should be accessible under Appearance/Editor. When you log into your dashboard, find that file. It’s called functions.php, but in the Default Theme for example, it’s called “Theme Functions”.
Once you find the file, insert this line of code under the header information in the file:
remove_filter('template_redirect','redirect_canonical');
It should only take up one line, and not be attached to any other lines of code.
This code should allow any visitor to your site to access your wordpress site using both the WWW prefix, and without the prefix.
What if I want either one, but not both?
Forget getting into that .htaccess file – there’s an easier way.
Under your blog’s general settings, WordPress asks what you want the address of your blog to be:

Rather than dealing with hacking into code, simply type in either the www prefix before your domain name, or leave the WWW off. Whatever you put in is what WordPress will use to index you. It’s as simple as that!
WordPress makes life on the web so much easier in so many ways. It’s a great, customizable CMS, and when it comes to optimizing your SEO in whatever way possible, WordPress has that kind of flexibility. Just figure out what your preferred prefix option is, and use the handy tips above to customize your installation. Remember to check your SEO rankings regularly!

