I couldn’t find a good comprehensive solution for this posted anywhere on the net, so I thought I’d share what I learned.
Since setting up this WordPress-based blog, the WebDAV file store for my zotero (a research tool) has been dead. When trying to reach the WebDAV directory, WordPress “intercepted” my request and showed me a WordPress 404 error instead. For the impatient, the workaround is to add two ErrorDocument tags to the WordPress .htaccess file.
My final .htaccess file looks like
ErrorDocument 401 /misc/myerror.html ErrorDocument 403 /misc/myerror.html # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
Of course, you must also create the error document /misc/myerror.html.
For the curious (and for the googlebots searching for this solution), the problem was that WordPress and WebDAV wouldn’t work together on Dreamhost. WordPress pretty URLs use mod_rewrite, which intercepts visitors to the WebDAV-enabled directory. The mod_rewrite block includes the conditions
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
that appear to instruct mod_rewrite not to touch existing files or directories. However, they’re not doing their job for some reason. Likely, the issue is caused by the .htaccess file that Dreamhost uses in the WebDAV-enabled directory to enable password-protection. This file (and the entire WebDAV directory) is owned by dhapache, so there’s not much we can do about this file as users. Regardless, it turns out that Dreamhost doesn’t have proper handler set for 401 and 403 errors. Thus, adding the following two lines to the root .htaccess file does the trick:
ErrorDocument 401 /misc/myerror.html ErrorDocument 403 /misc/myerror.html
Voila! We have WordPress and WebDAV working together on Dreamhost!



Thanks for posting these instructions. I just spent the past hour battling the exact same problem, and finally found the StackOverflow page and this post. It’s working now!
I’m happy this could be of use to others as well. =D
This worked for me on dreamhost with WordPress and some normal password-protected sub folders in my domain. Thanks for the easy solution!
Excellent! I’m glad to hear that it works for normal password-protected folders, too!