mod rewrite - Apache Virtual Hosts and mod_rewrite conflicts -


I am breaking the net and SO and I can not get around this problem.

We have a bunch of subdomains and some dedicated servers, a server re-issue tracking and landing page as triple duty. The problem is that the wildcard landing page never takes you to the right virtual host page. I'm looking at wildcards but they are particularly broad.

Our scenario is low:

- www.askia.com is the main landing site. A non-current (wildcard) subdomain should always be here.
- dev.askia.com is technical support and problems site. It has some mod_rewrites for https. It took me a while, but I had to do this and I do not want to break it.
- www.askia.fr is our French site, instead of taking you www.askia.com , it takes you to dev.askia.com.
- You must take www.askia.co.uk www.askia.com but dev.askia.com

I am not completely sure why I should try to fix the solution. Should I Do Something In CNAME? In the virtualhostconfig file or in the mod_rewrite file.

Try these rules:

  rewrite% {HTTP_HOST} ^ Dev \. RewriteCond% {HTTP_HOST}! ^ Dev \ .askia \ .com $ RewriteRule ^ http: //dev.askia.com% {REQUEST_URI} [L, R = 301] rewrite% {HTTP_HOST}! ^ Www \ .askia \. Com $ RewriteCond% {HTTP_HOST}! ^ Dev \ .askia \ .com $ RewriteRule ^ http: //www.askia.com% {REQUEST_URI} [L, R = 301]  

The first rule dev Redirects every request to host starting from , but dev.askia.com to www.askia.com no. And the second rule redirects the request to a host other than www.askia.com and dev.askia.com to www.askia.com is. Therefore, every request must go to dev.askia.com or www.askia.com .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -