Thanks to the amazing Apache guruishnocityness that is Nathan Dove, my tag URLs are now beautified.
For others who use Ultimate Tag Warrior as their WordPress tag plugin of choice but can’t seem to get the pretty URLs to work, the fix was actually relatively simple. Simply insert the following in wp-includes/classes.php, line 1542:
if (!preg_match("!^tag/!", $request_match) && (preg_match("!^$match!", $request_match, $matches) ||
preg_match("!^$match!", urldecode($request_match), $matches))) {
Thanks again to Nathan Dove for the fix, and Christine Davis for creating UTW in the first place. You rule!
Hi. I'm Dean. Welcome to Dean(ish). I don't blog nearly as much as I used to, but I'm trying to get better. What do you expect when I have a full-time job, a wife, two kids, a cat, a fish, a leopard gecko, and a (semi-recently manifested) lack of creativity? At least I have a Twitter now. You can also check me out on Netvibes and Facebook. View my "complete" profile.
Dave
July 24th, 2006 at 2:34 am
I’m going to have to look into all this wordpress hocus pocus at some point. I feel very backward not knowing about it! It might be an idea to create something similar for the MS .NET Framework if it hasn’t already been done.
All your talk of tags has made me think about seeing if I can get something similar running on my site.
Nathan
July 25th, 2006 at 12:30 am
Big up to Christine and the WordPress people who did the real heavy lifting.
The above fix resolves the problem wherein WordPress is configured with permalinks whose first component is alphanumeric (e.g. /%category%/%postname%/). In these cases, WordPress’ internal rewriter intercepts the URL and tries to interpret “tag” (e.g. http://site/tag/name) as a category, and throws a 404 unless there happens to exist the post “name” in the “tag” category.
Other workarounds may include somehow prioritizing UTW, or $use_verbose_rules, but I don’t like the lengthy .htaccess that it creates.