我使用这个移动 htaccess 重定向代码:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (mobile|android|iphone|ipod|ipad|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iris|kindle|sgh|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|operamini|palm|plucker|pocket|psp|samsung|sanyo|sch|smartphone|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windowsce|xda|xiino) [NC]
RewriteRule ^(.*)$ url1 [R=302,L]
现在,我想保留该代码,同时将来自某些特定国家的移动用户重定向到不同的 url2。我怎样才能做到这一点?下面的代码是解决方案吗/这两个代码都可能存在于 htaccess/ 中吗?
RewriteEngine On - /for all users/
RewriteCond %{HTTP_USER_AGENT} (mobile|android|iphone|ipod|ipad|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iris|kindle|sgh|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|operamini|palm|plucker|pocket|psp|samsung|sanyo|sch|smartphone|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windowsce|xda|xiino) [NC]
RewriteRule ^(.*)$ url1 [R=302,L]
RewriteEngine On - /only for Ca, US and MX for example/
RewriteCond %{HTTP_USER_AGENT} (mobile|android|iphone|ipod|ipad|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iris|kindle|sgh|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|operamini|palm|plucker|pocket|psp|samsung|sanyo|sch|smartphone|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windowsce|xda|xiino) [NC]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CA|US|MX)$
RewriteRule ^(.*)$ url2 [R=302,L]
谢谢你。