WordPress-Christmas-2010-08

Pretty permalinks without mod_rewrite

There are still some third-class web hosters who do allow the .htaccess files … and turn off the standard module mod_rewrite. But without mod_rewrite, WordPress cannot use pretty permalinks, right? Wrong!

There’s another directive we can use: ErrorDocument.

ErrorDocument 404 /index.php

This will do almost the same as the rewrite rules WordPress offers. It will not work with caching plugins like W3 Total Cache, it will not catch empty searches and other .htaccess tricks you may want to use. So consider this trick as a temporary solution until you have found a real web hoster.

Comments are closed.

7 comments

  1. Donncha O Caoimh

    I presume WordPress doesn't think every url is a 404? This should work with WP Super Cache in "PHP caching" mode, but I haven't tested it of course!

  2. toscho

    This is about the server, not WordPress. The trick is to send any request that doesn’t match an existing file to WordPress like the usual .htaccess rules do.

  3. Joshua chase

    Great tip, I didn't realize you can use error document that way. Iand so true "find a real host" lol.

  4. Frederick Townes

    Similiar to what Donncha said, Basic mode will work fine in this case described here with W3TC as well as all of the other performance optimizations it provides.

  5. Kaspars

    You have to be careful with this because WordPress doesn't set the HTTP Status header 200 by default. Just make sure that all your pages are not returning 404 status header when using this approach.

2 pingbacks

  1. Adventskalender am 8. Dezember « F-LOG-GE
  2. WordPress: Entwickler-Guide WP 3.3, sprechende Permalinks ohne mod_rewrite | WordPress & Webwork