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
7 responses to “Pretty permalinks without mod_rewrite”
[…] WPEngineer schreibt Thomas Scholz einen kurzen Tip, wie man bei schlechten Hostern schöne Permalinks über die htaccess-Datei erzeugen kann, […]
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!
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.
Great tip, I didn’t realize you can use error document that way. Iand so true “find a real host” lol.
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.
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.
[…] zwar den Zugriff auf .htaccss, aktivieren aber anderseits das mod_rewrite nicht. Thomas Scholz beschreibt wie man hier trotzdem noch zu sprechenden Permalinks kommen […]