Syndication IconNew article alerts are available via Atom. Hide this message

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.

Leave feedback...

Commenting is closed for this article.

About the boy

A picture of Craig in grayscale

Hi, I'm Craig and I'm a Ruby coder. I live, work and play in London. I like scaling applications and eating yoghurt. Sometimes I climb rocks. Most of the time I climb back down.

You can contact me by email, MSN or Jabber. My address on all of these is craig@xeriom.net.

Code Licence

You can use any of the code on this blog in any way you want. It's totally public domain. You don't even need to attribute it to me, although it would be nice if you did. Just don't sue me.

Friends and colleagues

Other Reading

I Work With Rails

Recommend Me

My Travels

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