Wordpress 2 permalink issues

| | Comments (8)
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
digg| bookmark

8 Comments

mbf said:

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.

blacknight said:

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

mbf said:

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.

blacknight said:

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

mbf said:

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.

blacknight said:

mbf - thanks for the analysis ...
I think I'll just have to wait and see if a patch is released ..

mbf said:

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.

blacknight said:

mbf - mod_rewrite is very cool, but it's total voodoo to me

Michele Neylon - cartoon picture

About this Entry

This page contains a single entry by Michele Neylon published on January 19, 2006 2:13 AM.

My Mobile Is Possessed! was the previous entry on this site.

IE Pricing 2006 Revisited is the next entry on this site.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.1