A temporary .htaccess rewrite fix for Ultimate Tag Warrior and Wordpress 2.0

I’ve been using this blog and my running blog for testing out Wordpress 2.0 before trying things out on the main site. This evening’s task has been setting up tagging on my running blog. I’ve been using Jerome’s Keywords for a while, but have been reading good things about Christine Davis’ Ultimate Tag Warrior and decided to give it a try.

Ultimate Tag Warrior is extremely comprehensive and flexible. There are versions for both Wordpress 1.5.x and Wordpress 2.x, although I’m only working with the later version. The plugin works smoothly after being activated, and the only tricky part has been that URL rewrites are different in Wordpress 2.x. — rewrites are now done within Wordpress rather than in the .htaccess file, which seems like a good idea, but in the meantime this plugin and others are still a little in transition.

As currently shipped, the plugin automatically generates rel=”tag” links for Technorati, and can be configured to point to other tag services or use local tags. The URL rewrite problem breaks “clean URLs” for local tags of the form http://site/tag/localtagname, so if you just want to generate Technorati tags you’re already in good shape. Without working URL rewrites, other features like local tag clouds don’t work so well though.

In the meantime, here’s a temporary fix (from comments posted by Stephen Collins) which can be added to the .htaccess file in the root directory of the Wordpress installation. The example here is for http://www.hojohnlee.com/running/, you should change the paths to match your own.

This fix is unlikely to be needed for very long, there is a lot of activity underway among Wordpress plugin developers to get things working with the new version. If you put this in place, you should probably keep an eye on the Ultimate Tag Warrior page or the Wordpress support forums for updates.

# UTW

RewriteEngine On
RewriteBase /running/
RewriteRule ^tag/?(.*)/feed/(feed|rdf|rss|rss2|atom)/?$ /running/index.php?tag=$1&feed=$2 [QSA,L]
RewriteRule ^tag/?(.*)/page/?(.*)/$ /running/index.php?tag=$1&paged=$2 [QSA,L]
RewriteRule ^tag/?(.*)/$ /running/index.php?tag=$1 [QSA,L]
RewriteRule ^tag/?(.*)/page/?(.*)$ /running/index.php?tag=$1&paged=$2 [QSA,L]
RewriteRule ^tag/?(.*)$ /running/index.php?tag=$1 [QSA,L]

Update 02-08-2006 22:30 PST:
After upgrading to Wordpress 2.0.1, it looks like this fix for .htaccess is still needed with the version of Ultimate Tag Warrior that I’m currently using (2.9.2.1) over on my running blog.

Wordpress 2.x has moved the URL rewriting out of .htaccess and mod_rewrite and into classes.php. This provides access to more hooks forl plugin developers in the future, but in the meantime this seems to be causing a lot of problems with non-standard permalink structures or custom rewrite rules.

6 Responses to “A temporary .htaccess rewrite fix for Ultimate Tag Warrior and Wordpress 2.0”

  1. Alan Gutierrez Says:

    Thanks for the hack. The default tag rewriting is touch and go. This is a great cut and paste fix to the problem. You do need to be careful that when you run other plugins that change .htaccess, namely the FeedBurner plugin, that your rewrite are not overwritten.

    Thank you.

  2. Alan’s Blogometer » Blog Archive » Blog Unrolling Says:

    […] Alas, it does’t quite work so apply the changes to the .htaccess file outline in A temporary .htaccess rewrite fix for Ultimate Tag Warrior and Wordpress 2.0. Unfortunately, installing the FeedBurner plugin overwrites the changes, so I’ve moved the FeedBurner step before this one. […]

  3. WordPress Tagging » Nathan’s Blog Says:

    […] Once I resolved some minor rewrite problems, Christine Davis’ brilliant plugin Ultimate Tag Warrior allowed me to add a tag cloud to my humble blog. I extended HJL’s workaround to fix problems I encountered with both tag feeds and traditional feeds. […]

  4. Yo, Toledano » Blog Archive » Feed en UTW Says:

    […] El problema es en .htaccess y la forma en como lo maneja Wordpress. si embargo encontre un post dónde se menciona la solución y efectivamente resuelve el problema de las feed. Como muchas cosas, no entiendo con claridad la solución, básicamente porque están involucradas las expresiones regulares. Si embargo funciona. El código despúes de estos anuncios: […]

  5. Faboi Says:

    Hello,

    I tried unsuscesfully to install the semantics urls with UTW. I explain the problem in this phorum:

    http://www.neato.co.nz/forum/read.php?5,1417

    I apreciate if anybody could help me.

    Thanks!

  6. Tag Clouds For WordPress and WordPress MU | Art of Blogging Says:

    […] The solution though was not too difficult. Hacks and Gadgets by HCL offered this .htaccess rewrite fix for Ultimate Tag Warrior which squared me right on up. As Christine Davis of UTW pointed out in the comments on her groovy plugin, be sure to put the .htaccess lines above the WordPress lines. Take a look at this example .htaccess file. […]

Leave a Reply