Short URLs

This plugin is NOT WordPress 2.0 compatible and there are no plans to make it so.

Description:

This REALLY simple plugin allows you to use a short URL to your post. It also redirects any page loads of “index.php?p=#” to the permalink of the post.

This plugin is also smart enough to not try and redirect any page loads of “index.php?p=#” when you aren’t using permalinks. (Although there is really no need to be using this plugin if you aren’t using permalinks as your URL is already about as short as it can get.)

Basically, I wanted like ?p=#, but that wasn’t ugly.

Usage:

Click here to see it in action: http://viper007bond.com/post/38. Clicking that link will take you to a post about WordPress v1.5.2 being released and note that the URL in your address bar is now the full permalink.

Also try visiting this link that I don’t want people really using: http://viper007bond.com/index.php?p=38

The “38″ is the post ID of that post. Easiest way to find the ID of your post is to hover over your edit link, or if you don’t have one, look on the manage page in your WordPress admin.

You could also place some code like this somewhere in The Loop if you wanted to create short links on your site:

<a href="<?php bloginfo('url'); ?>/post/<?php the_ID(); ?>" title="Short URL to this post">Short URL</a>

Bug Fixes in v1.01:

If a post didn’t have a permalink and you tried to link to it, either with /post/# or index.php?p=#, it’d get stuck in an infinite redirection loop. This has now been fixed so that it doesn’t redirect if there’s no permalink.

Download:

Support / Feature Request Forum:

http://www.viper007bond.com/wordpress-plugins/forums/viewforum.php?id=13

7 Comments On This Page

  1. Avatar

    Does the plugin use redirection to take to the long url form the short one?

    what exactly is tht type of redirection it is using?

  2. Avatar

    It uses PHP’s header() to send the data to the browser:

    header('HTTP/1.1 301 Moved Permanently');
    header('Location: ' . get_permalink($_GET['p']));

    The 301 code is so that the short URLs don’t get indexed by search engines.

  3. Avatar

    Version 1.01 released. Fixed a silly redirection loop bug that existed. :/

  4. Avatar

    hi
    thanx for this plugin, but i encountered errors with my .htaccess, once the plugin activated you said ” Please visit your permalink page as to update your .htaccess file after activating.”… ok what i’ve done but i dont know what do i write for the structure…so now i cannot use my .htaccess without returning errors…if only i could have too your entire .htaccess, i think that’ll resolve the prob…i think

    thanx again

  5. Avatar

    ok it seems to work now…sorry

    and good work

  6. Avatar

    Good to hear you got it working. :)

  7. Avatar

    This plugin appears to NOT be compatible with WordPress v2.0 Beta 2.

Leave a Comment

PLEASE DO NOT USE THIS COMMENT AREA FOR SUPPORT REQUESTS!! Instead, please use the support forums that I've specificly set up to handle all problems and bug reports for the plugins listed on this site. You can find them right here.

If you would like to leave a trackback to this entry, use this URL. This is also a Gravatar enabled blog, so if you have a Gravatar account, use it!

 

Click Here to Quote Any Selected Text On The Page

XHTML: You can use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

#