View Single Post
Old 10-23-2012, 09:33 AM  
antini
Confirmed User
 
Join Date: Jun 2003
Posts: 633
Help needed with htaccess mobile redirect & multiple country redirect

What I would like to achieve thru .htaccess (would like to avoid php or javascript) is the following:
1. Send mobile surfers from some German speaking countries to e.g. http://www.mysite.com/mobile1/
2. Then, send all other mobile surfer (i.e. rest of the world) to e.g. http://www.mysite.com/mobile2/
3. And finally, of course send all non-mobile surfers to my regular site http://www.mysite.com/

Btw, I also have mod_geoip installed on my server.

The code down here should take care of take care of points 1. and 3.:
Code:
RewriteEngine on
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]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^AT$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CH$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^DE$ [NC]
RewriteRule ^[^/]*$ http://www.mysite.com/mobile1/ [R=302,L]
But, is it possible to include 2. as well in this code? If yes, any suggestions?
Thanks in advance!
__________________
ADULT SPONSOR DB - With Advanced Search Function

Email: kvnmedia [AT] gmail.com
antini is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote