How do I rewrite a request by hostname unless it is a specified value?
- by Tim
My app will have a regular domain - let's say example.com - which will have information about logging in, signing up, etc. It will also host numerous other domains dynamically. My app serves the webpage for these at http://example.com/site/foobar.com/
So, I need to redirect all requests where the hostname is not example.com to /site/[hostname]/
I'm writing this in Django and hosting with Apache.
How do I set up a rewrite rule to do this? The user must not know they are on any other site but foobar.com and if the user browses to foobar.com/something - the URL must be rewritten to /site/foobar.com/something