WordPress.org

Ready to get started?Download WordPress

Forums

New Plugin: Cannonical URL (6 posts)

  1. IsaacSchlueter
    Member
    Posted 8 years ago #

    Want to redirect any ?p=123 URLs to their proper permalink?

    Check out http://isaacschlueter.com/plugins/i-made/cannonical-url/

    This also works on any "shortcut" URLs that you may have. For example, if you have rewritten /p123 to index.php?p=123, then this plugin will also redirect any such requests to their proper permalink location.

    This only works on single-post requests. If there's enough interest, I may expand it to redirect other kinds of URIs.

  2. jcostom
    Member
    Posted 8 years ago #

    Perhaps I'm missing something.. Unless you're on a non-Apache server, which isn't the case for you, at least, what's the benefit here? If you're on an Apache-based server, why not just use mod_rewrite?

  3. IsaacSchlueter
    Member
    Posted 8 years ago #

    Oh, the plugin won't be of much value if you don't use pretty permalinks (it'd be kind of silly then.)

    The value is that, even with mod_rewrite, a person still *can* go to index.php?p=123. In fact, I sometimes write non-standard single-post URIs in my own posts, simply because /p303 is less typing than /2005/10/sidebar-expando/. However, if a user clicks on that link, or if a search engine stumbles across it, I still want them to go to the proper permalink URI instead.

    Hence, the plugin. :)

    Doing these redirects with mod_rewrite would be impossible. The idea is to take ANY request for a single post, and redirect it to the cannonical permalink.

  4. lynk
    Member
    Posted 8 years ago #

    if activated, 404 handling doesn't work properly anymore

  5. IsaacSchlueter
    Member
    Posted 8 years ago #

    Ah! Thanks, Lynk!

    Problem fixed now. It's kind of odd that get_permalink returns something even when there are no posts.

  6. IsaacSchlueter
    Member
    Posted 8 years ago #

    That problem, along with a few others, has been solved in the new version, available now.

Topic Closed

This topic has been closed to new replies.

About this Topic