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.

About the boy

A picture of Craig in grayscale

Craig Webster is a software engineer living in London. He usually works with Ruby although sometimes he sneaks in some Erlang or JavaScript. He's into rock climbing, snowboarding, skating, photography and fencing. Yes, this does mean he has a sword.

Near here you'll find Craig's homepage, contact details, PGP key and keysigning policy, and talks.

Licence

The entire content of this blog is public domain. Use it however you fancy. You don't even need to attribute it to me, although it would be nice if you did. Just don't sue me and we'll all be happy.

I Work With Rails

Recommend Me

My Travels

I go places. Do you go places too? Let's meet up!.