Skip to content

Instantly share code, notes, and snippets.

@auniverseaway
Created March 8, 2017 18:45
Show Gist options
  • Save auniverseaway/b38170a60f71f5c5363c128a3b0e748a to your computer and use it in GitHub Desktop.
Save auniverseaway/b38170a60f71f5c5363c128a3b0e748a to your computer and use it in GitHub Desktop.
Vhost Redirect Block
SetEnvIfNoCase Request_URI "^/([^/]+)/([^/]+)" LOCALE=$1/$2
<If "tolower(%{ENV:LOCALE}) in {'hr/hr', 'il/he', 'mena/ar', 'ro/ro', 'sk/sk', 'si/si', 'ua/ua', 'si/en', 'ee/en', 'kr/ko', 'in/en', 'sea/en', 'tw/zh-Hant', 'hk/zh-Hant', 'hk/en', 'bg/en', 'lv/en', 'mx/es', 'gr/en', 'nl/nl', 'be/nl', 'lu/en', 'ca/en', 'sk/en', 'il/en', 'ch/fr', 'be/fr', 'lu/fr', 'mena/en', 'mt/en', 'se/sv', 'be/en', 'lt/en', 'ro/en', 'it/it', 'no/no', 'lu/de', 'za/en', 'at/de', 'de/de', 'es/es', 'cy/en', 'ru/ru', 'nz/en', 'ie/en', 'uk/en', 'dk/da', 'ca/fr', 'fi/fi', 'la/es', 'mena/fr', 'ua/en', 'rs/en', 'hr/en', 'br/pt', 'pt/pt', 'ch/de', 'pl/pl', 'jp/ja', 'fr/fr', 'ch/it', 'tr/tr', 'hu/hu', 'langmaster/en', 'au/en', 'us/en', 'cn/zh-Hans', 'cz/cs'}">
ErrorDocument 404 /%{ENV:LOCALE}/404.html
ErrorDocument 500 /%{ENV:LOCALE}/500.html
</If>
<Else>
ErrorDocument 404 /us/en/404.html
ErrorDocument 500 /us/en/500.html
</Else>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment