Support » Installing WordPress » wp’s htaccess / virtual folders / a different (better?) solution

  • The default mod_rewrite approach of

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /misc/wp/index.php

    is overly aggressive for me — I have various virtual folders, like /trac and /svn, which don’t exist on disk, so wordpress claims them when it shouldn’t. I’ve found this:

    ErrorDocument 404 /misc/wp/index.php
    ErrorDocument 403 /misc/wp/index.php

    to work much better, as it only claims files that don’t exist (phyiscally *and* virtually), thus allowing me to have the SVN controlled virtual /svn, the trac-controlled virtual /trac, and the WP controlled virtual /2006/02/blah/etc all working happily side by side 🙂

    Most people can probably do without the 403 handler, I’m just using it for situations where eg I have a /pics/ folder full of pictures, which does exist (so not a 404), but I want WP to handle it (by turning off autoindex, it becomes a 403, which WP then handles as normal)

    There is no index.* file in the root folder, this is 403.
    The entire /2006/ heirachy doesn’t exist, so is a 404.
    Trac still works, which was my original problem (cgi-bin is probably a more common problem)
    And pages that *do* exist on disk? they work too ^_^

  • The topic ‘wp’s htaccess / virtual folders / a different (better?) solution’ is closed to new replies.