csswizardry/sampenrose.co.uk — comment on commit 8dde5c2b2eca2e300e68e4af21ae2364b02309da
File:  line 0
By makeusabrew:

Things worth noting gents:

1) it explicitly won't redirect if your host is localhost - rewrites are a pain with relative paths (e.g. localhost/work/sampenrose.co.uk) so it's easier to just only apply them on a "proper" domain
2) it's a bit messy because apache re-runs the rules when performing the internal rewrite (2nd rule) so had to put in the THE_REQUEST check to stop the first rule kicking in on rewrite causing an infinite loop.
3) it should work on your live server but I couldn't get the specific details of it so might not. You'll know if it doesn't - you'll get a 500 error pretty swiftly :)