Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.