1

I apologize if this question has already been asked.

I am looking for a solution to make SetEnv use the %2 variable.

Is that even possible?

My vhost:

<VirtualHost *:80>
        ServerName dev.someuri.nl
        ServerAlias *.*.dev.someuri.nl
        VirtualDocumentRoot /home/%2/www/%1
        LogLevel debug

        SetEnv DEVELOP_ENV dev
        SetEnv DEVELOP_NAME %2
</VirtualHost>
Wesley van Opdorp
  • 291
  • 1
  • 3
  • 10

1 Answers1

1

I have found an answer to my problem using SetEnvIf.

<VirtualHost *:80>
        ServerName dev.someuri.nl
        ServerAlias *.*.dev.someuri.nl
        VirtualDocumentRoot /home/%2/www/%1
        LogLevel debug
        SetEnv DEVELOP_ENV dev
        SetEnvIf Host "^(.*)\.(.*)\.dev\.someuri.nl" DEVELOP_NAME=$2
</VirtualHost>

Hope it helps people googling themselves silly.

Wesley van Opdorp
  • 291
  • 1
  • 3
  • 10