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
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.
mbf – thanks for the suggestion. Only problem is that the log output isn’t too helpful.. or at least I can’t make much sense of them
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.
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
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.
mbf – thanks for the analysis …
I think I’ll just have to wait and see if a patch is released ..
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.
mbf – mod_rewrite is very cool, but it’s total voodoo to me