In my httpd.ini I redirect all traffic from "example.co.uk" to "www.example.co.uk", the below works fine for this:
RewriteCond %HTTPS off
RewriteCond Host: (?!^www.example.co.uk)(.+)
RewriteRule /(.*) http\://www.example.co.uk/$2 [I,RP]
I have a bunch of microsites which also use this website, say "www.foobar.co.uk", set in the Host Headers of IIS 6. With the above rules, "www.foobar.co.uk" ends up at "www.example.co.uk"!
Is there a RewriteCond I can do against the request to make sure that the request is for "example.co.uk" to not capture the microsites and rewrite those? Or even better, a way I can take any request, be it "example.co.uk" or "foobar.co.uk" and just wack a www in front of it?
Thanks for your help.