=== GoCodes === Contributors: redwall_hp Plugin URI: http://www.webmaster-source.com/gocodes-redirection-plugin-wordpress/ Author URI: http://www.webmaster-source.com Donate link: http://www.webmaster-source.com/donate/ Tags: redirection, tinyurl, 301, url shortener, url Requires at least: 2.0.2 Tested up to: 2.6 Stable tag: 1.2.2 An URL redirection/shortener plugin. Great for podcasting and redirecting affiliate program URLs. == Description == Have you ever had to give someone a shortened version of a URL? Maybe you're a podcaster, and you can't say "visit mydomain.com/2008/01/03/my-post-with-a-long-url/ for more info." Wouldn't it be useful if you could just say "go to mydomain.com/go/mycoolpost/ ?" Sure, you *could* use a service like tinyurl.com, but that's still not too great if you need the URL for a podcast. It's still awkward to read-out "tinyurl.com/27asr9," isn't it? It's less professional too. GoCodes let's you create shortcut URLs to anywhere on the internet, right from your Wordpress Admin. The plugin is also useful for masking affiliate program URLs. == Installation == 1. FTP the entire gocodes directory to your Wordpress blog's plugins folder (/wp-content/plugins/). 2. Activate the plugin on the "Plugins" tab of the administartion panel. 3. Place the following code in your .htaccess file, above the line that says "# BEGIN WordPress": `RewriteEngine On RewriteRule ^go/([a-zA-Z0-9_-]*)/?$ /index.php?gocode=$1 [L,R]` This example assumes your blog is located at the root of your domain. If your blog is located at yourdomain.com/blog/, then you should change "/index.php" to "/blog/index.php". 4. Refer to the usage section of this guide. == Upgrading == 1. Deactivate plugin 2. Upload updated files 3. Reactivate plugin Upgrade notes: * You may use the autmoated plugin updater in WordPress 2.5+ with this plugin, but make sure you read the upgrade notes of the latest version after upgrading. * If you are upgrading from GoCodes 1.1.1 or prior, remove the gocodes.php file, and upload the new gocodes directory. To ensure compatibility with WordPress 2.5, some changes were made that expect gocodes.php to reside in a /gocodes subdirectory * If you are upgrading from a version prior to 1.2.1, you must update your .htaccess file again. Change the line `RewriteRule ^go/([A-Za-z0-9]+)/?$ /index.php?gocode=$1 [L,R]` to `RewriteRule ^go/([a-zA-Z0-9_-]*)/?$ /index.php?gocode=$1 [L,R]`. == Frequently Asked Questions == = How do I add a redirect? = To manage your redirects, open your Wordpress admin, and go to the Manage -> GoCodes menu. From there you can remove redirects by clicking on the "Delete" button next to their entries, and you can add new ones using the form on the page. The "Key" field is where you enter the redirection string (e.g. "orange" in yourdomain.com/go/orange/). The URL field is where you enter the URL that users will be redirected to ("http://" is required). Note that the Key can only contain alphanumeric characters. == Screenshots == 1. The GoCodes redirect management page in the WordPress Admin. == Known Issues == = WP Super Cache = There seems to be a conflict with the WP Super Cache plugin where a redirect will only work once before the cache is cleared. There are a couple of workarounds: 1. Add "index.php" on a new line in the "Rejected URLs" field of the WP Super Cache options page. yourdomain.com/ will be cached still, but /index.php won't. 2. Frederick of frederickding.com put together another method. Add this line to your .htaccess file above the WP Super Cache line: "RewriteCond %{QUERY_STRING} !.*gocode=.*" It should look something like this: RewriteCond %{QUERY_STRING} !.*gocode=.* RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L] == Version history == 1. Version 1.0 2. Version 1.1 - Adds hit count and uninstaller 3. Version 1.1.1 4. Version 1.2 - Ensures total WordPress 2.5 compatibility, adds the ability to edit redirect entries and reset hit counts. Some interface improvements introduced as well. 5. Version 1.2.1 - Adds support for dashes and underscores in redirection keys. See upgrade notes if you are upgrading from an older version.