[wp-hackers] Permalinks via 404

Ryan Boren ryan at boren.nu
Sat Sep 4 18:38:56 UTC 2004


On Sat, 2004-09-04 at 11:31 +0200, Tara Star wrote:
> Ryan Boren wrote:
> > Since people are noticing and commenting on this, I'll give it a
> > mention.
> > 
> > Remove all of your rewrite rules.  Replace them with:
> > 
> > ErrorDocument 404 /index.php?error=404
> > 
> > If you're serving index.php out of a subdirectory, be sure to prefix
> > it:  /wordpress/index.php?error=404.
> > 
> > You can use is_404() within index.php to handle the case where the
> > requested URI could not be matched, or you can redirect to a separate
> > 404 page.
> 
> but then you get a server error log full of 404's...

True.  The client doesn't see the 404, but the server still sees it and
logs it.  This is just another option for those who either despise
mod_rewrite or don't have it available.  Some other sites and software
use and offer this method, so we added it since it required very little
extra code.  The same mechanism used for PATH_INFO is used for 404.
Anyway, you can put the ErrorDocument call after your rewrite rules and
it will act as a backup.

Ryan




More information about the hackers mailing list