Enforce www. Preference

About

This plugin will help preserve your permalinks by enforcing your no-www or yes-www preference (http://example.com/ vs. http://www.example.com/) and will strip off index.php from the ends of URIs.

Download

Instructions

  1. Download and unzip
  2. Upload enforce-www-preference.php to /wp-content/plugins/
  3. Activate from within the WordPress admin interface

Versions

  • Version 1.3 Changed the name, and moved to my /code/ section
  • Version 1.2 Initial release

I’ve spent a lot of time writing this code and supporting it. If you derive some benefit from this code, please consider showing your gratitute in a more tangible
way. Thanks!

I have received $0 this month for my coding efforts.

Donate with PayPalAmazon.com Wishlist


413 Responses to “Enforce www. Preference”

Comment pages: [1] 2 3 4 »

  1. CountZero |

    As nice as neat and useful. Very nice piece of code - I love it, especially as it’s getting me rid of these nasty XMLHttpRequest object restrictions referring crossing domain borders.

  2. Monika |

    HI
    I activate your plugin- but know I would not use it.
    I deactive it,
    but the uri is not avaible under
    wohnungen-in-karlsruhe.de

    but I have to use it under this domain and not under
    http://www.wohnungen-in-karlsruhe.de

    how can I repair this.
    Your plugin is not activ..

    :(
    please help me
    thanks a lot
    Monika

  3. Monika |

    Oh!
    I have to move the rewrite rules at the end of the htaccess

    ‘I’m happy ‘
    :-)

    have a nice day
    Monika

  4. Ken Savage |

    There’s no admin options page for this plugin? How do I know that I’m redirecting domain.com to http://www.domain.com

  5. Dan |

    Great plugin, until now I’d been manually editing the .htaccess files on all my blogs.

  6. _ck_ |

    Very handy plugin, thanks.

    I modified the code with just a wrap of
    if (!headers_sent()) {
    }

    because in some weird circumstances, it’s possible for wordpress to be accessed outside the normal visitor flow (for example if it’s accessed outside the loop on pages external to WP) and headers will already have been sent (I discovered this by accident and my visitors were getting nasty warning messages for a whole week! :eek: ).

  7. Innovation Zen |

    when I first download the plugin the standard setting it to redirect domain.com to http://www.domain.com or the other way round?

    and how do you customize it?

  8. Mark (post author) |

    Innovation Zen,

    It follows whatever you have set as your Blog URI in Options > General

    If you use http://www. there, it will use it. If not, it won’t.

  9. Ted Sisul |

    Great plugin! Nice job!!

    I have one question though. Is there a way to alter the plugin to allow…

    http://site.com/category/ to redirect to http://www.site.com/category/ ?

    Right now http://site.com/category/ redirects to
    http://www.site.com/ instead of keeping the subdirectory

    I know I can do this on a case by case basis with the .htacesss file (site is hosted on Linux), but can it be done dynamically? I ask because my category and archive folders will update every month, and it will be a pain having to update the .htaccess file every month as well. Thanks again!!

    -Ted

  10. Scott Hendison |

    wow -
    Fast, instant solution. Thanks! and I’ve donated to more than triple your donations for the month. Nice work!

  11. Travis |

    I activated the plugin but it doesn’t do anything. My site still shows up as “http://” in the browser. Am I missing a step?

    I noticed the WordPress URI and the Blog URI are set to http:// Do I need to change these to www? And if I do, will it screw anything up? I have no idea what the WordPress URI and Blog URI are so I don’t want to touch them until I know for certain my site won’t get screwed up.

    Thanks.

    Travis

  12. PCMasters |

    A great plugin for wordpress.
    Thanks for the work, great done.

  13. Gary |

    Just was wondering which Wordpress versions this plugin will work with?

  14. Elisa |

    First time here on your site. I am delighted to find your wonderful website online. Would you please also visit my homepage?

  15. Shannon |

    Great looking site so far!! I’m just starting to look around it but I love the title page! Would you please also visit my site?

  16. Phillip |

    Hi there! Your site is cool, indeed! Please visit my homepage too:

  17. Lambeth |

    Your site looks great! Would you please also visit my site?

  18. Coleman |

    Exelent! Good work! Please visit my site too:

  19. Chuck |

    Hi people! Great job! Visit my sites, please:

  20. gleam |

    Nice stuff, this what i’m looking for.
    Thanks.

  21. Warren |

    Brilliant plugin, thanks!

  22. Mic |

    Great Plug-In, thanks a bunch and keep on this good work!

    Cheers,
    Mic

  23. SearchEngineChannel |

    Good job on this, much respect!

  24. Maureen Francis |

    Is there support anywhere for this plugin? I installed it. Google can no longer spider my site. I’ve uninstalled it now I still get a message that google cannot find my robots.txt file so still cannot be spidered. Clearly I did something wrong, but I don’t know how to correct it.

Comment pages: [1] 2 3 4 »

Leave a Reply