![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: May 2002
Posts: 4,982
|
![]() I want to redirect visitors from specific countries, can this be done with htaccess? If yes, then what is the code I need?
__________________
Surrender all your independent thinking and Click Here for re-programming. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Apr 2002
Location: Virgin - nee
Posts: 3,162
|
You can use .htaccess to pre-append a php file to be included on all of your pages.
In that php file you can do the geo-targeting. Check out www.maxmind.com for php scripts to geo-target or whip up a self-made solution using Lee's tutorials at ARS Resources. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Oct 2002
Location: USA
Posts: 2,796
|
Redirecting by country or region would be hard to do with .htaccess, because of the loose association between IP assignments and countries... but there are services out there that keep up with this, and with some work, you may be able to get a good database of them going.
These links might be a starting point: http://www.ip-to-country.com/ http://where-is.info/help.html
__________________
![]() Ouch. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Feb 2002
Posts: 1,751
|
trafficjuicer.com - 3 lines of cut and paste code into html.
__________________
<a href="http://www.jupiterhosting.com"><img src="http://www.jupiterhosting.com/banners/55x55.jupiter.gif" alt="" border="0" align=""></a> |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Feb 2001
Location: UK
Posts: 543
|
You can do it based on browser language via .htaccess, but the issue is whether browser language is accurate enough for what you want to do with your traffic.
If its just being used to block .jp traffic, then htaccess probably is sufficient. If you wanna redirect lots of different countries to different page/show different content, then you need a proper script. Hit me up richard {at} ip-sorter.com or icq 41012160 if you wanna chat about foreign country filtering / redirecting / targeting etc. Check this url if you're happy with doing it in htaccess: http://www.bowiesnyder.com/writings/nls_apache.htm
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |