edvanleeuwen
Verified User
- Joined
- Nov 18, 2013
- Messages
- 155
I am trying to pass all requests from domain.com to https://www.domain.com, but not for alt.domain.com. I created alt.domain.com as a normal domain, not a subdomain.
I created a custom token to indicate what the base domain is:
In the custom virtual_host2.conf I put:
Although the BASEDOMAIN is set properly to "1" when the domain is the base domain, the virtual host config always shows the else part.
Does anyone see what I am missing?
I created a custom token to indicate what the base domain is:
Code:
DOMAIN_T=domain.com
In the custom virtual_host2.conf I put:
Code:
|?BASEDOMAIN="0"|
|*if DOMAIN=DOMAIN_T|
|?BASEDOMAIN="1"|
|*endif|
|*if DOMAIN=DOMAIN_O|
|?BASEDOMAIN="1"|
|*endif|
|*if BASEDOMAIN="1"|
ServerName www.|DOMAIN|
ServerAlias www.|DOMAIN| |DOMAIN| |SERVER_ALIASES|
Redirect "/" "https://www.|DOMAIN|/"
|*else|
ServerName |DOMAIN|
ServerAlias |DOMAIN| |SERVER_ALIASES|
Redirect "/" "https://|DOMAIN|/"
|*endif|
Although the BASEDOMAIN is set properly to "1" when the domain is the base domain, the virtual host config always shows the else part.
Does anyone see what I am missing?