-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
  • 35,228
  • 6
  • 51
  • 80
Black
  • 15,426
  • 32
  • 140
  • 232

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
  • 35,228
  • 6
  • 51
  • 80