-1

I am using this code to set the varialbe MAGE_RUN_CODE. How can I make Android|Opera case insensitive in SetEnvIf User-Agent Android|Opera MAGE_RUN_CODE=app?

SetEnv MAGE_RUN_TYPE store
SetEnvIf Host ^company.de MAGE_RUN_CODE=default
SetEnvIf Host ^app.company.de MAGE_RUN_CODE=app
SetEnvIf User-Agent Android|Opera MAGE_RUN_CODE=app
MrWhite
  • 43,179
  • 8
  • 60
  • 84
Black
  • 18,150
  • 39
  • 158
  • 271

1 Answers1

1

Use the SetEnvIfNoCase directive instead to enable a case-insensitive match. For example:

SetEnvIfNoCase User-Agent android|opera MAGE_RUN_CODE=app

Reference:


Alternatively, you can use the (?i) mode modifier on the regex itself. For example:

SetEnvIf User-Agent (?i)android|opera MAGE_RUN_CODE=app

Reference:

MrWhite
  • 43,179
  • 8
  • 60
  • 84