.htaccessに、下記のように記述。
全キャリア共通の携帯ページにアクセスさせる場合。
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^(DoCoMo|KDDI|DDIPOKET|UP¥.Browser|J-PHONE|Vodafone|SoftBank)
RewriteRule ^$ /mobile/ [R]
上記の場合のディレクトリ構造は
┌─
├mobile[携帯用ディレクトリ]
│└index.html[携帯用トップページ]
├.htaccess[作成したファイル]
│index.html[PC用ページ]
└─
├mobile[携帯用ディレクトリ]
│└index.html[携帯用トップページ]
├.htaccess[作成したファイル]
│index.html[PC用ページ]
└─
各キャリアごとの場合
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} DoCoMo
RewriteRule ^$ http://example.jp/i/index.html [R]
RewriteCond %{HTTP_USER_AGENT} J-PHONE
RewriteRule ^$ http://example.jp/j/index.html [R]
RewriteCond %{HTTP_USER_AGENT} UP.Browser
RewriteRule ^$ http://example.jp/au/index.html [R]