Custom Virtual Host Syntax

ساخت وبلاگ
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:

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?

DirectAdmin Forums...
ما را در سایت DirectAdmin Forums دنبال می کنید

برچسب : نویسنده : ایمان اصلاحی directadmin بازدید : 279 تاريخ : شنبه 25 فروردين 1397 ساعت: 22:26