Redirecting specific country to sub folder by IP Geo Cloudflare

I use this for my .htaccess to redirect visitor base their IP by using IP Geolocation Header Cloudflare.

I am use Wordpress Multisite, I hope domain.com/it/ if the visitor come from italy, and domain.com/br, if visitor come from brazil.

This .htaccess used to be works before I changed my wordpress to Wordpress multisite.

But It is not working now. Please help me, thank you in advance. Please help me, thank you in advance.

BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]

uploaded files

RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP:CF-IPCountry} ^IT$
RewriteCond %{REQUEST_URI} !(?:gif|png|jpg|jpeg|css)$ [NC]
RewriteRule !^it/ /it%{REQUEST_URI} [NC,NE,R,L]

RewriteCond %{HTTP:CF-IPCountry} ^BR$
RewriteRule !^br/ /br%{REQUEST_URI} [NC,NE,R,L]

END WordPres

That was discussed at GeoIP redirection worker

This topic was automatically closed after 14 days. New replies are no longer allowed.