Sunday, January 23, 2011

Forcing WWW to Show in URL in Wordpress

Wordpress is a great place to host a blog, but it does have its frustrations.  I won't go into them all here, but one thing that I and others have found very frustrating is forcing the web address to show 'www' before the domain name. 

Why is this important?  There are several reasons.  First, search engines don't like it when a website's address will sometimes show as www.example.com and other times it shows as example.com.  Search engines will sometimes view this as two different websites with duplicate content.  The easiest way to fix this is to force the URL to always show the www before the domain name.

Some Wordpress Plugins (like S2Member) also require the 'www' in the URL in order to function properly.  The trick, however, is getting the job done.

If you search the web, you'll find a plethora of information about how to force the www in the URL.  Some sites suggest editing the HTACCESS file.  This may or may not work depending on your setup, but it didn't work for me.

I also tried calling tech support for my host (GoDaddy.com) for help in reconfiguring the CNAME in the Domain Manager.  This didn't work either.  The good folks at GoDaddy informed me that things were set correctly to force the www on the server, but that Wordpress was overwriting their configuration. 

After hours of frustration of trying every suggestion on the web, I finally found the answer in the Wordpress settings (and you wouldn't believe how simple it was to fix)!  Here's how I fixed the problem.
  1. Log into Wordpress
  2. On the left side of the screen, scroll down to SETTINGS and click GENERAL
  3. Change the Wordpress Address URL) to www.example.com (replacing example.com to your domain)
  4. Change the SITE URL to www.example.com (replacing example.com  with your domain)
  5. Scroll down and click the blue SAVE CHANGES button
 That's it.  No need to edit the HTACCESS file, PHP files, or any other files (in this case anyway).

2 comments:

  1. Thanks for the post!! I've been chatting to my host and they were telling me that I need to change the htaccess file and that they wouldn't do it and offered no support if i messed it up. I just logged into wordpress, like you said, and it worked perfectly. Thanks!!

    ReplyDelete
  2. We all know that WordPress is hands down the very best blogging platform… #2 isn’t even close.

    ReplyDelete