One of the problems with using WebDAV is that you can't open (GET) files that have any kind of server-side rendering, like PHP files. When you open these files, if you can open them over WebDAV at all, you're treated to the rendered page. That sucks!
Here's where mod_rewrite comes in. Apache comes with a very powerful rewriting engine, which allows you to change the content of just about everything on the fly. We can use this power to turn our dynamic pages into something static to suit our editing needs.
Chances are your WebDAV directory configuration in httpd.conf looks something like this:
<Directory /Library/WebServer/Documents/dav>
DAV On
AllowOverride AuthConfig
Options FollowSymLinks Indexes
AuthName "WebDAV Restricted"
AuthType Basic
Require valid-user file-owner file-group
</Directory>
Read the rest of the hint for the changes to implement mod_rewrite...
Now then, if we add the following two lines, in this case, to be able to edit PHP pages, we're in business:
RewriteEngine on
RewriteRule (.*).php$ - [T=text/plain,L]
For the final product below:
<Directory /Library/WebServer/Documents>
DAV On
AllowOverride AuthConfig
Options FollowSymLinks Indexes
AuthName "WebDAV Restricted"
AuthType Basic
Require valid-user file-owner file-group
RewriteEngine on
RewriteRule (.*).php$ - [T=text/plain,L]
</Directory>
So what's going on here? The first line tells Apache to turn on the Rewrite engine. Simple enough. In the second line, we're saying "All URLs that end with .php (the regular expression), do not rewrite the URL (the hyphen), but change the MIME-type to text/plain (the T=text/plain), and make this the last rewrite rule, so that we don't get stuck in a recursive loop (the L)".
Mac OS X Hints
http://hints.macworld.com/article.php?story=2003072620172473