: Htaccess redirect based on country of origin Can a rule that filters and redirect traffic based on country of origin be implemented in .htaccess? Can it be implemented in any other way then
Can a rule that filters and redirect traffic based on country of origin be implemented in .htaccess?
Can it be implemented in any other way then by an IP address? I need the solution to be as accurate as possible.
More posts by @Gretchen104
2 Comments
Sorted by latest first Latest Oldest Best
Yes, we used to filter visitors from Nigeria by .htaccess:
RewriteEngine On
RewriteCond %{ENV:IP2LOCATION_COUNTRY_SHORT} ^NG$
RewriteRule ^(.*)$ www.google.com [L]
You can generate your own at ip2location.com/free/visitor-redirection .
Maybe this link (how to redirect domain according to country IP address) can help you.
I think, however, that this is not a good practice.
Redirection by language or country is quite strict. It is better preferred:
A message at the top of your site that influence the visitor to go to
the page built with his language.
A system that can easily change the language (flags)
This is only my opinion.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.