[Techtalk] weird wordpress error: 404 on % in permalinks

James Sutherland james at deadnode.org
Sat Oct 20 08:29:05 UTC 2012

Hi Carla,

A 404 means Apache is looking for the wrong filename. By default, Wordpress will use a URL like /index.php?id=123 - so Wordpress's index file gets loaded and asked for page 123, nice and simple. To make a link like /2012/10/20/wordpress-permalinks work, you need to tell Apache to look for /index.php instead.

Putting this line in .htaccess should send all requests for things that aren't actual files/directories to Wordpress instead:

ErrorDocument 404 /index.php

Alternatively, this might do the trick:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.* /index.php

That should fix the 404 errors, at least, by sending all the requests to Wordpress to handle. The 400s on "invalid-looking" % sequences makes me wonder if there might be some kind of security module trying to interpret data, and choking on "invalid" sequences which would work fine if Wordpress got them? Is there any module like that loaded?

More information about the Techtalk mailing list