Redirect non-www to www in Wordpress

For years now, search engines have been struggling with the different variations of domains. For some off reason requests for www.seoweblog.com, seoweblog.com and seoweblog.com/index.php, while obviously return the same page, get indexed as 3 different pages…

The consequinces: Pagerank splits, Backlinks split and lastly you’re risking getting filtered for duplicate content by the new filters at Google.

Over at b5media, we’ve been looking for a way to redirect all non-www request to the appropriate variation of the address, and since all blogs run Wordpress it’s been a challenge to do it through the software itself rather than through the Apache server settings.

Last week, Matt introduced a plugin that takes all requests for the www version of a site and return a consistent non-www address with the appropriate redirect methods. The plugin, while working good, is only a partial solution as it does not include the index.php requests.

I took the same plugin and created a complementary, improved version of it. Since I like to have all www addresses, I’ve redirected all non-www to www and all index.php to /.

So far it seems to work fine, however, I’m open for suggestions, comments or complaints…

Download: yes-www.zip

Installation Instaructions:

1. Unzip the file.
2. Upload to your Wordpress plugin folder.
3. Activate from within Wordpress admin.

Updates:

Date Version Changes
9/10/2006 0.30 The plugin caused an error when using the wp theme editor. Aparently, it caused an endless redirection loop when editing the homepage. Anyways, now it doesn’t…
6/20/2006 0.20 Previeus version did not process GET queries such as search queries… Added processing for queries and rewrote plugin for smaller / faster version. (Thanks Aaron for your contribution)
6/19/2006 0.10 First version, my first plugin ever, may lack be missing some details, please let me know if anything is not-working / missing.

Related Entries:

  • Wordpress Category as Subdomain Plugin
  • Comments (30) to “Redirect non-www to www in Wordpress”

    1. […] Gilad has produced a WP plugin that resolves the non-www/www/index.php issues with WP and that redirects them all to one consistent location. […]

    2. […] Hvis du har en WordPress-blog og insisterer på at gøre det omvendt (dvs. tvinge folk til www), kan du i stedet bruge yes-www. […]

    3. […] Wordpress plugin: yes-www » […]

    4. […] Redirect non-www to www in Wordpress… If you need to redirect variations of URL’s to the www prefix, this could be your solution in Wordpress. Free Plug-in download. […]

    5. […] Yes WWW For de fleste gør det næppe den store forskel om man bruger problog.dk, www.problog.dk eller http://www.problog.dk/, men når vi taler søgemaskineoptimering, er der en forskel. Ikke alle søgemaskiner kan regne ud at der er tale om samme domæne. Yes WWW sørger for at indgangen til alle variatonerne ender samme sted og fjerner “problemet”. Hvis du vil se en live-demonstration, kan du jo prøve at taste problog.dk og se hvad der sker… […]

    6. […] During the most recent open mic session at Successful Blog I was asking the participants about some problems I’m having with Technorati. In the midst of that, Joe at Working at Home on the Internet suggested I try the WordPress plugin yes-www. […]

    7. […] Recently, I wrote a post hoping to be heard. It was to Gilad Gafni, who wrote a WordPress plugin, yes-www. It’s designed to help with SEO, link building, etc. Definitely worthwhile, I thought. But I discovered a bug in the plugin, and couldn’t find a way to contact Gilad easily on his blog. So, I wrote about it here. […]

    8. […] You on Top SEO for Blogs […]

    9. Thanks Gilad, plugin works great for me.

      [Reply]

    10. […] Yes WWW. Here’s another no-brainer for the SEO-savvy. This plugin 301 redirects all non-www requests for your blog to the www version. No fuss, no muss, no messing with cryptic htaccess directives. Anything that lets me avoid dealing with regular expressions is a welcome addition in my book. […]

    11. […] Yes WWW by Gilad Gafni […]

    12. The only problem I’m having when activating plugin is no one can make comments. Any suggestions, I tried to deactivate it and reactivate it.

      [Reply]

    13. Anyone have any ideas on this. I get a blank page when clicking submit and the comment is not posted. This only happens with this plugine enabled.

      [Reply]

    14. […] http://blog.youontop.com/seo-for-blogs/redirect-non-www-to-www-in-wordpress-29.html […]

    15. Thanks a lot Gilad…This work for me.

      [Reply]

    16. […] Visit […]

    17. […] Yes WWW by Gilad Gafni […]

    18. […] Yes-www - make sure that all pages are either with the “www” or without, depending on your preference. The advantage of this plugin is that it also deals with index.php requests, and redirects them accordingly. […]

    19. […] If you use the www version, use the Yes-WWW plugin. […]

    20. Awesome! This works for wordpress and bbpress! :D

      [Reply]

    21. […] Decide whether or not to use www in your URLs and be consistent about it. The yes-www plugin is great for this. Also be sure to set your preference in the Google Webmaster Console. […]

    22. […] Decide whether or not to use www in your URLs and be consistent about it. The yes-www plugin is great for this. Also be sure to set your preference in the Google Webmaster Console. […]

    23. […] Decide whether or not to use www in your URLs and be consistent about it. The yes-www plugin is great for this. Also be sure to set your preference in the Google Webmaster Console. […]

    24. […] Decide whether or not to use www in your URLs and be consistent about it. The yes-www plugin is great for this. Also be sure to set your preference in the Google Webmaster Console. […]

    25. […] I also might note that there are a couple wordpress plugins that complete these exact functions. Here is one that I found and here is another. In addition, because this is my first time attempting this, you may run into some problems/issues/variances. Heck… I might to. But in the long run it’s all for the better! […]

    26. […] para evitar que Google indexe ambas. La manera más fácil de conseguir ésto es con el plugin non-www to www, solo debemos instalarlo y […]

    27. […] whether or not to use www in your URLs and be consistent about it. The yes-www plugin is great for this. Also be sure to set your preference in the Google Webmaster […]

    28. […] para evitar que Google indexe ambas. La manera más fácil de conseguir ésto es con el plugin non-www to www, solo debemos instalarlo y […]

    29. Will it also convert the non-www up to sub-folders?

      [Reply]

    30. […] whether or not to use www in your URLs and be consistent about it. The yes-www plugin is great for this. Also be sure to set your preference in the Google Webmaster […]

    Post a Comment
    *Required
    *Required (Never published)