httpd.conf – How do I use a custom variable in an If-Else statement within an Apache configuration?

Here is my code (I commented the if-else part, since it does not work)

Fragments / content of my configuration files

/etc/httpd/conf.d/staff.vhost

Define host_domain "staff"

Includes /etc/httpd/conf.d/stage_template.vhost

/etc/httpd/conf.d/stage_template.vhost

                #
    # ServerAlias ​​stage.myhost.com
#
    #
        Stage ServerAlias ​​- $ {host_domain} .myhost.com
#

$ {host_domain} can have 3 possible values: main or staff or customer

I have tried these comparisons

  • "$ {host_domain} == & # 39; main & # 39;"

    AH00526: Syntax error on line 9 of /etc/httpd/conf.d/stage_template.vhost: Unable to parse the condition clause: syntax error, unexpected T_OP_STR_EQ, waiting & # 39; (& # 39;

  • "% {host_domain} == & # 39; main & # 39;"

    AH00526: Syntax error on line 9 of /etc/httpd/conf.d/stage_template.vhost:
    Unable to parse the condition clause: analysis error near & # 39;% & # 39;

  • "& # 39; $ {host_domain} & # 39; == & # 39; main & # 39;"

    AH00526: Syntax error on line 10 of /etc/httpd/conf.d/available_vhosts/stage_template.vhost:
    ServerAlias ​​not allowed here

I was using this page as a guide. But it has no example when using custom variables.

Thank you!