So I want to redirect based on countries (for language purposes), however how do I do this, since it only works for one country code. I have added my list to the private php but how do I call it in jquery?
Where do you have this file "assets/php/geo.php" hosted? Can you give me the URL, or probably give me the FTP of your site so I can check what it returns and the JS file to edit.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
So I want to redirect based on countries (for language purposes), however how do I do this, since it only works for one country code. I have added my list to the private php but how do I call it in jquery?
Here is what I have:
and here is my array in the geo.php file:
and here is in the "country match" section:
Hi,
In that file called geo.php you can simply output the country code:
Then you can process the country codes in JS:
I've included the following code:
just to show that you can match multiple country codes to match single landing page.
I hope this makes sense for you.
It still is not working. It all just defaults to to en.
Where do you have this file "assets/php/geo.php" hosted? Can you give me the URL, or probably give me the FTP of your site so I can check what it returns and the JS file to edit.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Hi rmbettencourt,
Thanks for providing credentials, can you please tell me the domain name because I cannot access your site?!
Hi,
The page assets/php/geo.php was showing PHP errors:
(view large version)
So I have created a new file for you, and renamed that geo.php to geo-old.php
So now the new geo.php file returns properly the GEO code:
http://rosalinebettencourt.com/assets/php/geo.php
This should work for you.
Great! So is the code on index.html correct? The main index.html file in the root folder.
Here is it as well:
Hi,
Yes thats the correct code, you can manage the list of countries in the array for specific country code with redirection.
Now it seems to work just fine!