I’ve been scouring the net and SO and I can’t get around or through this problem.
We have a bunch of subdomains and a few dedicated servers. One server does double-triple duty as issue tracking and landing page. Problem is the wildcard landing page doesn’t take you to the correct virtual host page sometimes. I’ve been looking at wildcards but they seem particularly broad.
Our scenario is the following:
–http://www.askia.com is the main landing site. A non-existing (wildcard) subdomain should always land here.
–dev.askia.com is the technical support and issues site. It has some mod_rewrites for https. It took me a while, but I got it to work and I’d rather not break it.
–http://www.askia.fr is our french site. Instead of taking you to http://www.askia.com it takes you to the dev.askia.com.
–http://www.askia.co.uk should take you to http://www.askia.com but it goes to dev.askia.com
I’m not entirely sure where I should be trying to fix the solution. Should I do something in the CNAME. In the virtualhosts config file or in the mod_rewrite file.
Try these rules:
The first rule redirects every request to a host starting with
dev.but notdev.askia.comtowww.askia.com. And the second rule redirect requests to a host other thanwww.askia.comanddev.askia.comtowww.askia.com. So every request should either go todev.askia.comorwww.askia.com.