Hello, to be able to use .htaccess, you will have to install and configure mod_geoip for apache, to be able to identify the country of your visitors.
Where to install and activate
mod_geoip? Does it help me to setup somethings like this
If
US audience, they will visit example.com by default on Web CMS 1
If
UK audience, they will visit example.com/cms2/ by default, cms2 is built on Web CMS 2
You can do exactly the same with php, but it will probably loading faster if the redirection is handled by your web server.
I still use normal PHP redirection code?
i.e
PHP:
<?php
// PHP permanent URL redirection
header("Location: http://www.example.com/cms2/", true, 301);
exit();
?>
I suggest to let your application handle it [ PHP level ] in case you want to track anything related to this visit/redirection. You will also get a versatility to handle any additional things [ like showing personalized contents or specific other things ] from application level later on.
I am tending to use PHP codes because I see it is flexible to use redirections than .htaccess