Using .htaccess to easily redirect AU traffic to

Hello Team

My .htaccess skills aren’t really up to scratch so I’m asking for some help from the community :slight_smile:

I have a website at and some some content relevant only to Australia at - I want to automatically redirect any customer visiting from Australia to while obviously allowing users from any other region to to go to as normal.

I also have the domain behind Cloudflare, therefore I have the IP Geolocation setting on, which allows the IP Geolocation information from the CF-IPCountry HTTP header.

I already had a Google around and I found this for .htaccess:

SetEnvIf CF-IPCountry “(.)$” Country=$1
RewriteCond %{ENV:Country} BE
RewriteRule ^(.
)$$1 [R,L]

This is as per

Will this snippet be valid? I would really appreciate any help with this task!

Thanks so much!

@contact17 Hey there. I’m curious to know if you got this working. Did you use the snippet you posted above or a variation of the one in this KB article - ?

Hey there, I never actually attempted to implement this either way. I had a plugin already set up at the time to take care of these redirects, and my intention was to remove that plugin and replace it with the above code instead.

In the end, I decided to keep the plugin after all. Sorry that I couldn’t be of more help :slight_smile:

Ah okay. Thanks for following up to let me know. If you don’t mind, which plugin did you use to handle the redirection?

Sorry for late reply. I ended up using but to be honest it’s not all that great.

The admin screen for this plugin is super confusing and all over the show. Took a lot of trying and emails between the developer to get it working nicely with WP Rocket.

I would recommend looking for something else, I think there are other plugins that tackle the same issue.