Htaccess redirect based on country of origin
Htaccess redirect based on country of origin -
Solution :
Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.
.htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, redirects, country-specific, , .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :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.
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.
Yes, we used to filter visitors from Nigeria by .htaccess:
RewriteEngine On
RewriteCond %ENV:IP2LOCATION_COUNTRY_SHORT ^NG$
RewriteRule ^(.*)$ http://www.google.com [L]
You can generate your own at http://ip2location.com/free/visitor-redirection .
Comments
Post a Comment