このモバイル 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]
ありがとうございました。