GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Need help with htaccess mobile and country redirect (https://gfy.com/showthread.php?t=1025638)

cybermike 06-07-2011 11:07 AM

Need help with htaccess mobile and country redirect
 
Ok this is what I use to redirect mobile traffic

#redirect mobile browsers

RewriteCond %{HTTP_USER_AGENT} ^.*iphone|ipod|ipad|blackberry|android|sgh|sonyeri csson|psp|mot|htc|lg|nokia|palm|treo|j2me|webos|sm artphone|symbian.*$ [NC]
RewriteRule ^(.*)$ RewriteRule .* http://domain/mobile/ [R=302,L]

Now how do I keep my US/Canada traffic to going to http://domain.com/mobile and have the following countries go to http://domain.com/mobile2

Germany
France
Sweden
etc

I'm not having much luck messing around with php I rather do this in htaccess

Thanks

fuzebox 06-07-2011 12:45 PM

Easiest way for you would be to use the free maxmind country database: http://www.maxmind.com/app/geolitecountry

Ask your host to install mod_geoip, and then you can add the geoip stuff to your htaccess files alongside the mobile redirection.

http://www.maxmind.com/app/mod_geoip


All times are GMT -7. The time now is 04:27 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123