PHP头文件位置功能到新的PHP文件无法正常工作

I have uploaded a site in english(http://calvindeveloping.tk) but i want to redirect the user if they are from a french countryto this site path - http://calvindeveloping.tk/fr/index.php, so i used the geolocation plugin, the plugin works... except when i try using it in the php header function like this -

if ($geoplugin->countryCode == "FR" || $geoplugin->countryCode == "fr") {
header('Location: calvindeveloping.tk/fr/index.php');
}

Here is my full php code for the english version of the site, placed just before the html code.

$geoplugin = new geoPlugin();
$geoplugin->locate();

$extra = 'fr/index.php';
if ($geoplugin->countryCode == "FR" || $geoplugin->countryCode == "fr") {
header('Location: calvindeveloping.tk/fr/index.php');
exit();
}
?>

Please help as this doesnt seem to work.

Remove that exit() function and replace your location function with the below function i wrote.

  header("Location: http://www.calvindeveloping.tk/fr/index.php");

Modified version of your code

 if ($geoplugin->countryCode == "FR" || $geoplugin->countryCode == "fr") {
 header("Location:http://www.calvindeveloping.tk/fr/index.php");
 }

Your code for header should be

header('Location: http://calvindeveloping.tk/fr/index.php');

Sice you are