WordPress 2 permalink issues

Apologies to anyone currently getting apparent 404 errors on the categories:
irishblogs
blogging
For some annoying reason the wordpress 2 way of handling permalinks is redirecting all requests for any category containing the phrase “blog” to the main page and giving an internal 404 (though apache sees it correctly as a 200 NOT a 404)
I’m not alone in having problems it seems
Dear WordPress Developers – is this a bug or is the feedburner plugin causing the issue?
For those of you who understand mod_rewrite better than I, my .htaccess contains the following:

# BEGIN WordPress

RewriteEngine On
# Redirect FeedBurner to your own Feed
RewriteBase /blog/
RewriteRule ^feedburner_346435/?$ /blog/feed/ [R,L]
RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
# These Rules redirect all feed Traffic to FeedBurner
RewriteBase /blog/
RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
RewriteRule ^(.*)$ http://feeds.feedburner.com/blacknight [R,L]
RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ http://feeds.feedburner.com/blacknight [R,L]
RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php http://feeds.feedburner.com/blacknight [R,L]
# These are the standard WordPress Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php

# END WordPress

If anyone can see anything obviously wrong with that please let me know

Published
Categorised as Random

By Michele Neylon

Michele is founder and CEO of Irish hosting provider and domain name registrar Blacknight.

8 comments

  1. Have you tried turning on rewritelog?
    In your virtual host definition, try the following (it won’t work in .htaccess):
    RewriteLog /var/log/apache/rewrite.log
    RewriteLogLevel 3
    It should let you know exactly what’s going on.
    Just remember to turn it off when you’re finished.

  2. If you want to turn on logging, request something that’s messing up and then post the resulting snippet of log here (or email it to me) along with the url you requested, I’ll have a look for you.
    I can’t promise to find the problem, but I’ll give it a go.

  3. mbf – thanks for the offer 🙂
    I think the issue is wordpress’ internals, as if you remove the feedburner redirects you end up with:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /blog/index.php
    which works fine as long as the string you are rewriting doesn’t include “blog” ie. the path where this blog lives.
    I’ve pasted a section of logs over on pastebin anyway:
    http://pastebin.com/515456
    TIA
    Michele

  4. Given that I don’t know wordpress or any of its internals, I can tell you what’s happening, but not why.
    The rewrite conditions test archives/category/techie-techno/blogging/. First test passes (is not a file). Second test passes (is not a dir), RewriteRule rewtites it to /blog/index.php, causing an internal redirect and passes it through the rules again.
    This is probably correct as wordpress would then parse the REQUEST_URI and figure out what to do from there. My guess is a rogue php ereg_replace for blog (or the contents of some variable which happens to contain ‘/blog/’) in WordPress which messes up.
    If the same rewrite happens when you request a category that works then it’s definitely a wordpress issue.
    If you had copious free time you could install a second wordpress with a base of /golb/ and create categories called blog and golb and see which one works.

  5. No problem. I aw doing some mod_rewrite work myself just a couple of days ago and I thought it’d be a good opportunity to get some of the stuff I’d learnt reinforced by examining something I hadn’t written.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Exit mobile version