Category > escape
Aquarion's new web-based projecty thing
Formula One Diary
Interestingly, David Coulthard’s website is keeping a race diary blogish type thing, with their point of view on the races so far.
Mod Rewrite as a virtual hosting environment
So, I’ve now got control of istic.net. istic.net is going to have a number of subdomains, and I don’t really want to muck around with apache every time I want to add one, or get my Friendly Neighbourhood Sysadmin to do so.
Instead, I want mod_rewrite to do it, which it does. I have a virtualhost that handles *.istic.net, and passes it on to the following .htaccess file:
RewriteEngine on
RewriteRule ^.*.istic.net.*$ - [L]
RewriteRule (.*) %{HTTP_HOST}/$1
Which redirects “http://ritual.istic.net” to ”~/sites/istic/ritual.istic.net”, which is what I want.
That shouldn’t have taken as many hours as it did, so I’m writing it down.
Secondly, I’ve moved my braindump – hol.istic.net – to a temporary new home whilst the DNS resolves. By the wonders of my new domain name, it’s temporarily housed at supercalifragil.istic.net which is possibly the best subdomain ever :-)
So, my personal “hire me” site could go to “narciss.isitic.net”, I could move all my open source projects to “altru.istic.net”, set up a site about religion at ritual.istic, head of into the futur.istic and be all m.istic about it and whenever I got fed up with the whole blogging thing and needed to move, I can always go ball.istic.
This isn’t actually far from the plan, which is to move the far flung tin-pot empires of AqCom that are getting lost under five years of journal archives & articles, and move them to their own domains – or subdomains, or sub-subdomains – where they can live happily ever after.
Rory Parle:
Surely that first line just says to leave URLs containing “istic.net” alone, so that the second line doesn’t ever do anything? Given that I’m obviously wrong, I still can’t see exactly what the second line is doing either.
Pingter:
I use:
VirtualDocumentRoot /path/to/%0/
... but that only works if you want all hostnames handled like that. Although I guess if you had separate VirtualHost sections for specific hostnames it would work okay…
Kevin:
I’ve had extra hosts declared alongside dynamic hosts like that and it works pretty well. The only thing to remember is the dynamic entry needs to be the default VirtualHost.