How To Force Non-WWW vs WWW URL to Avoid Canonical Problems and Duplicate Content Penalty on a Wordpress Blog
I don't know if it's true, but there is speculation that Google will actually penalize your blog or website if the same pages can be reached with both the www and non-www URL address.
From a SEO perspective, it's better to be safe than sorry, and in any case I think it is a whole lot prettier when my blog is always innerblogger.com and not www.innerblogger.com. After all, the "www" is redundant isn't it.
Here's how you can force your pages to always appear as yourblog.com instead of www.yourblog.com, regardless of whether the user types the "www" or not.
You need to edit the .htaccess file. This file can be found in the root directory of your blog or website. Use cPanel File Manager to navigate to your root directory. Add the following lines to the very beginning of your .htaccess file and save the file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.innerblogger\.com$ [NC]
RewriteRule ^(.*)$ http://innerblogger.com/$1 [R=301,L]
Of course, you need to replace "innerblogger" with your own domain name.
Detailed instructions on how to do this using the cPanel:
1. Open File Manager
2. Navigate to your root directory. This is often called /public_html/, or if you have multiple blogs on one server, it could be /public_html/particularblog/ where particularblog stands for, well, the particular blog you are editing now.
3. Click on the file called .htaccess and then on the top right menu, select edit file
4. Copy and paste the above code to the beginning of the file and then save the file.
That's all there's to it. Type http://www.yourblog.com in your browser and admire the automatic truncation to http://yourblog.com.









and now my question is… how can i do exactly the contrary? i mean, i want to force a www.sonorama.net when ppl type only sonorama.net…
i’d love any help - thank you!