Tags, Part Deuce

July 23rd, 2006 Tagged with , , | 3 Comments »

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!


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

3 Responses to “Tags, Part Deuce”

  1. 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.

  2. 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.

  3. There are many resource sites listed in WordPress Goldmine that help you find content to post on your blog, and trust me, once you start researching around any topic long enough, you will have enough useful knowledge to tell interested visitors, and eventually make money from them when you recommend products to them

Leave a Reply