Use the '[NC]' flag to make the pattern matches case-insensitive. Use the '^' and '$' symbols in the country code and 'referer' conditions indicate the start and end of your respective strings -
RewriteRule Flags[
^]
The RewriteRule '^ - [L]' line used in my code is used to indicate that if any of the specified conditions are met, no further rewrite rules should be processed and the request should not be redirected, the '-' means no redirection -
RewriteEngine On
#Check if the user agent is not Googlebot...
RewriteCond %{HTTP_USER_AGENT} !Googlebot [NC]
#Check if the country code is not 'fr'...
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^fr$ [NC]
#Check if the HTTP referer is not 'test.com'...
RewriteCond %{HTTP_REFERER} !^https?:
#Check if the requested URL is 'page.php'...
RewriteCond %{REQUEST_URI} ^/page\.php/?$ [NC]
#Combine the conditions using the [OR] flag...
RewriteCond %{HTTP_USER_AGENT} !Googlebot [NC]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^fr$ [NC]
RewriteCond %{HTTP_REFERER} !^https?:
RewriteCond %{REQUEST_URI} ^/page\.php/?$ [NC]
RewriteRule ^ - [L]
#Your existing redirect code...
RewriteRule ^page.php/?$ $1/page2.php$2 [R=301,L]