Redirecting wordpress website visitors to a subdomain based on their country via htaccess code

271 Views Asked by At

I've tried implementing a solution I found that seemed simple enough, which is to just put this code at the top of the site's htaccess file:

#Redirect multiple countries to a single page
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CH|DE|AT)$
RewriteRule ^(.*)$ ch.mysite.com$1 [R,L]

Unfortunately, this doesn't seem to do anything at all. Did I misunderstand or misuse something, or are there additional changes I should have made?

This complete beginner thanks you for any help you may provide, even a nudge in the right direction.

0

There are 0 best solutions below