Server Variables (eg $VH_DOMAIN) in VH Template Rules?

#1
I've searched the forum and google and there appears to be conflicting answers.

When creating Virtual Host Templates, one uses variables that allow the templates to adapt dynamically ($VH_ROOT, $VH_NAME, $VH_DOMAIN, etc).

I cannot get these variables to work inside the Rewrite Rules; however, this is crucial for the dynamic capability of Templates.

For example, for hosts w/multiple domains that rewrite to the primary domain name:
Code:
RewriteCond %{HTTP_HOST} !$VH_DOMAIN$ [NC]
RewriteRule (.*) https://$VH_DOMAIN [R,L]
I've also tried escaping the variable \$VH_DOMAIN and wrapping in brackets {VH_DOMAIN} & {$VH_DOMAIN} but none of these have worked.

I also read that a custom variable could be set to the $VH_DOMAIN and that could then be used in the rewrite rules; however, I haven't found a way to do this, either.

Thank you in advance for any ideas :)
 

Cold-Egg

Administrator
#2
Hi, I think those variables can only be used for the server configs, not rewrite rules ~
I will confirm with the dev, if no update from me, then it means not supported.
 
Top