Wordpress Permalinks | Yep, another 404 error
I run my own servers here, so have complete control over Apache, .htaccess and so on. I recently setup a Wordpress (v2.8) blog and knew that I had all the correct settings to allow Permalinks to work (FollowSymLinks, AllowOverride etc.) when rewritten, but still no joy.
The Rewrite itself worked – since I could view all the categories and pages with rewritten URLs, so why wouldn’t my Permalinks work?
After searching and searching and searching and… I eventually discovered this post in the Wordpress forums: http://wordpress.org/support/topic/189058 which pointed out that the fix was as follows:
Settings->Permalinks screen, add some values in for the category and tag bases. The words “category” and “tag” will do just fine. As long as they are not blank, this should work around the bug.
Sure enough, this fixed the problem. Yay! no more scouring round the web just to find solutions that stated you needed a .htaccess file that contains this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
when you already have it and apache setup correctly!
P.S. I would recommend adding this to your .htaccess just before the </IfModule> to make sure your long titles (as inevitably there will at some point be one or two), get rewritten properly too:
RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA]
Your Wordpress should work ok now. Happy days (at last!)

