Don't rewrite UserDir requests
I have a site that's a Rails application which I also want to be able to use as my home on the web -- a place I keep the stuff that I want to share. Since I use Apache, the simplest way to do this is to use the UserDir module. Unfortunately, the way that I setup my applications catches all requests using mod_rewrite and, after some processing to make sure there's not a cached file to use, passes the request to an application server.
For my future reference, here's the necessary mod_rewrite voodoo to avoid rewriting UserDir requests.
# Don't rewrite UserDir requests
RewriteRule ^/~.*$ - [L]
All hail the mighty mod_rewrite cheat-sheet.
You can verify that I've written this post by following the verification instructions:
curl -LO http://barkingiguana.com/2008/02/25/dont-rewrite-userdir-requests.html.orig
curl -LO http://barkingiguana.com/2008/02/25/dont-rewrite-userdir-requests.html.orig.asc
gpg --verify dont-rewrite-userdir-requests.html.orig{.asc,}
If you'd like to have a conversation about this post, email craig@barkingiguana.com. I don't bite.