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

I'm trying to set various types of mobile-specific configuration based on environment variables.

The psudocode (psudoconfig) I was trying to do was something like:

<if environment variable = iphone> 
  ErrorDocument 404 /error_pages/404.iphone.html 

Where the env variable is set by the UA of the browser. I just haven't found a way in apache conf files to test for an environment variable - just to set it. Plenty of ways with SetEnfIf logic to SET environment variables, but not in the config or rewrite files to then test for variables & set results.

share|improve this question
possible duplicate of Using Apache Environment Variables to set custom ErrorDocument –  quanta Sep 23 '11 at 4:57
Thanks - though in this case I have potentially many more settings I'd LIKE to be able to include if I were able to use such if/else logic inside the conf files on a per-request basis. So if anyone has any bright ideas, I'm all for them. –  Tad Sep 23 '11 at 13:21

Your Answer


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

Browse other questions tagged or ask your own question.