Advertisement
ghiwar

redirect by country code

Oct 25th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. # Set the CF-IPCountry header value as "Country" variable
  2. SetEnvIf CF-IPCountry "(.*)$" Country=$1
  3.  
  4. # Than redirect it if the variable match. "ID" for Indonesia (rediect except)
  5. RewriteCond %{ENV:Country} !^(US|GB|MX|CA|FR|DE|BE|AU|NO|NZ|RO|RU|CH)$
  6. RewriteRule ^(.*)$ https://newdowmain.com/$1 [R,L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement