• ベストアンサー
※ ChatGPTを利用し、要約された質問です(原文:INDXの振り分けでソフトバンク)

SoftBankでの振り分けに関して

tkc2007の回答

  • ベストアンサー
  • tkc2007
  • ベストアンサー率50% (2/4)
回答No.1

これはnoachikoさんが書かれたコードですか? 携帯サイト用の振り分けをユーザーエージェント(ブラウザ情報)で考えるなら、 SoftBankに関してはSoftBank、Vadofone、J-PHONEを指定したほうが良いです。 noachikoさんがご利用になられているブラウザのユーザーエージェントが分からないので、 PCでアクセスすると携帯専用のindexへ…の部分の動作までは確認出来ませんが、 sub go { より上の部分のコードですが、これでどうですか? (コメント部分はちょっと省略してます) $vjump='./mi.html'; #SoftBank用 $ijump='./mi.html'; #i-MODE用 $ejump = './mi.html'; #EZWEB用 $pcjump = './index.html'; #PC,その他 $USR = $ENV{'HTTP_USER_AGENT'}; if ($USR =~ /^DoCoMo/) { $lct = $ijump; } elsif ($USR =~ /UP\.Browser/) { $lct = $ejump; } elsif ($USR =~ /^SoftBank/ || $USR =~ /^Vodafone/ || $USR =~ /^J-PHONE/) { $lct = $vjump; } else { $lct = $pcjump; } &go; exit;

関連するQ&A

  • モバイルの自動判別について

    こんにちは。先日softbankを使っているお客様からモバイルサイトが見れないとクレームが入りました。 調べると、Softbank,vodafoneについても記述しないといけないようですが以下のCGIは以前に友人に作ってもらっていたもので 自分ではCGIの知識がない為上手く修正できません。 softbank携帯で見れるようにするには どう修正したらいいのでしょうか。 どうかよろしくお願いいたします。 (モバイルサイトは皆同じアドレスです) #!/usr/local/bin/perl $lct=''; ##Jaup 1 $jphone='J-PHONE'; $jjump='http://www.○○.biz/i/index.html'; #j-Phone用 ファイルアドレス指定 ##Jaup 2 $imode='DoCoMo'; $ijump='http://www.○○/i/index.html'; #i-MODE用 ファイルアドレス指定 #$ezmode='UP.Browser'; $ezjump='http://○○/i/index.html'; ## ユーザーエージェント $USR = $ENV{'HTTP_USER_AGENT'}; if ($USR =~ /$jphone/i) { $lct = $jjump;&go;} if ($USR=~ /$imode/i) { $lct = $ijump;&go;} if ($USR=~ /$ezmode/i) { $lct = $ezjump;&go;} $lct='http://www.○○.biz/index.html'; #パソコン用 ファイルアドレス指定 # &go; exit; sub go { print "Location: $lct\n\n"; } exit;

    • ベストアンサー
    • CGI
  • 振り分けcgiについて

    現在下記のように書かれているcgiでトップページの振り分けをしています。今までは各htmに飛ばしていたのですが、今度モバイルのみcgi へ飛ばしたいのですが、i.htmの部分をmi.cgiと書き換えてもうまく飛びません。どうしたらcgiへ飛ぶようになるのでしょうか? $vjump='.i.htm'; #SoftBank用 $ijump='./i.htm'; #i-MODE用 $ejump = './i.htm'; #EZWEB用 $pcjump = './index.htm'; #PC,その他 $USR = $ENV{'HTTP_USER_AGENT'}; if ($USR =~ /^DoCoMo/) { $lct = $ijump; } elsif ($USR =~ /UP\.Browser/) { $lct = $ejump; } elsif ($USR =~ /^SoftBank/ || $USR =~ /^Vodafone/ || $USR =~ /^J-PHONE/) { $lct = $vjump; } else { $lct = $pcjump; } &go; exit; sub go { print "Content-type: text/html\n\n"; open(IN, $lct); while (<IN>) { print; } close(IN); } exit;

    • 締切済み
    • CGI
  • PHPによる端末振り分けについて

    宜しくお願いします。 現在は、PERLでPC・各携帯キャリアへの振り分けを行っております。ソースは・・・ #!/usr/bin/perl #index.cgi # #ジャンプ先の設定 # #iモード $imode = "http://www.****.jp/i/index.html"; #EZweb $ezweb = "http://www.****.jp/e/index.html"; #J-Sky $jsky = "http://www.****.jp/j/index.html"; #パソコン $pc = "http://www.****.jp/pc/index.html"; # #ブラウザ情報の取得 # $brwsr = $ENV{'HTTP_USER_AGENT'}; # #判別 # #iモードの判別 if ($brwsr =~ /DoCoMo/){ print "Location: $imode\n\n"; } #EZwebの判別 elsif ($brwsr =~ /UP.Browser/){ print "Location: $ezweb\n\n"; } #J-Skyの判別 elsif ($brwsr =~ /J-PHONE/){ print "Location: $jsky\n\n"; } #その他(パソコン) else { print "Location: $pc\n\n"; } exit; という形で自動振り分けをしておりますが、これと同じ機能をPHPで作るにはどうすれば良いでしょうか?

    • ベストアンサー
    • PHP
  • 携帯とPCの振り分け

    同じドメインにて携帯とPCの振り分けなのですが、htaccessにて振り分けたのですが、ブラウザに「振り分けがループしています」とでるのですが、 これはなぜでしょう? htaccessの中身の内容ですが、 DirectoryIndex index.php index.html index.htm これで読み込んだindex.phpの中身は <?php $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match("/^DoCoMo/i", $agent)){ header("Location: http://www.○○○○○.com/mobile/index.xhtml"); exit; }else if(preg_match("/^(J\-PHONE|Vodafone|MOT\-[CV]|SoftBank)/i", $agent)){ header("Location: http://www.○○○○○.com/mobile/index.xhtml"); exit; }else if(preg_match("/^KDDI\-/i", $agent) || preg_match("/UP\.Browser/i", $agent)){ header("Location: http://www.○○○○○.com/mobile/index.xhtml"); exit; }else{ header("Location: http://www.○○○○○.com/"); exit; } ?> サーバはlolipopでhtaccessのパーミッションは604で phpのパーミッションは700です。

    • 締切済み
    • CGI
  • phpでエージェントの振り分けがうまくいかない

    phpでエージェントの振り分けがうまくいかない 以下のようにmフォルダの中にindex.phpを以下の内容で設置し、同列でi,a,sフォルダを設け それぞれindex.htmlを設けました。しかし携帯でhttp://hoge.com/m で打つとサイトがみつかりませんになります。<?phpより上は空白、改行はありません。 振り分けがうまく機能しないのはなぜでしょうか? <?php $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match("/^DoCoMo/i", $agent)){ header("Location: http://hoge.com/m/i/index.html"); exit; }else if(preg_match("/^(J?-PHONE|Vodafone|MOT?-[CV]|SoftBank)/i", $agent)){ header("Location: http://hoge.com/m/s/index.html"); exit; }else if(preg_match("/^KDDI?-/i", $agent) || preg_match("/UP?.Browser/i", $agent)){ header("Location: http://hoge.com/m/a/index.html"); exit; }else{ header("Location: http://hoge.com/index.php"); exit; } ?>

    • ベストアンサー
    • PHP
  • i Phone 用振り分け

    以下のように携帯キャリアごとに振り分け、3キャリア以外は PCフォルダに振り分けるようにした場合ですが、PCフォルダの方で i Phone 用に幅480pxで作成したページを配置すると PCから http://mypage.net/ でアクセスしたユーザーにも i Phone 用の幅480pxページを見せるようになってしまいますか? i Phoneやスマートフォンの対処はどうされているんでしょうか? <?php $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match("/^DoCoMo/i", $agent)){ header("Location: http://mypage.net/i/index.html"); exit; }else if(preg_match("/^(J\-PHONE|Vodafone|MOT\-[CV]|SoftBank)/i", $agent)){ header("Location: http://mypage.net/s/index.html"); exit; }else if(preg_match("/^KDDI\-/i", $agent) || preg_match("/UP\.Browser/i", $agent)){ header("Location: http://mypage.net/e/index.html"); exit; }else{ header("Location: http://mypage.net/pc/index.html"); exit; } ?>

    • ベストアンサー
    • PHP
  • 携帯、スマートフォンのPHP振り分け

    こんなPHPを書いているのですが どうしてもParse errorが出ます。 解決方法を教えて下さい!! ■エラー内容 Parse error: syntax error, unexpected T_EXIT in /home/sites/heteml/users/web/m/index.php on line 5 ■振り分けPHP <?php $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match("/^DoCoMo/i", $agent)){ header("Location: ​http://www.hogehoge.com/m/i/index.html");​ exit; }else if(preg_match("/^(J\-PHONE|Vodafone|MOT\-[CV]|SoftBank)/i", $agent)){ header("Location: ​www.hogehoge.com/m/s/index.html");​ exit; }else if(preg_match("/^KDDI\-/i", $agent) || preg_match("/UP\.Browser/i", $agent)){ header("Location: ​www.hogehoge.com/m/e/index.html");​ exit(); }else if(preg_match("iPhoneやスマートフォン用の判定", $agent)){ header("Location: www.hogehoge.com/m/smt/index.html"); exit(); }else{ header("Location: ​www.hogehoge.com/m/pc/index.html");​ exit(); } ?> よろしくお願い致します。

    • ベストアンサー
    • PHP
  • ユーザーエージェントの振り分け

    すみません、エージェント振り分けで以下のようにPHPファイルを作りました。 そして各ホルダ i,s にindex.htmlを配置したところ Warning:Cannot modify header information headers already sent by (output started at /home/lolipop,jp-dp44253830/web/mobile/index.php:1) in/home/sites/lolipop.jp/users/lolipop.jp-dp44253830/web/mobile/index.php on line 4 index.php <?php $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match("/^DoCoMo/i", $agent)){ header("Location: http://homepege.net/mobile/i/index.html"); exit; }else if(preg_match("/^(J\-PHONE|Vodafone|MOT\-[CV]|SoftBank)/i", $agent)){ header("Location: http://homepage.net/mobile/s/index.html"); exit; 省略 } ?> お手数ですが教えてください。

    • ベストアンサー
    • PHP
  • ソフトバンクのUSERAGENTうまく取得できない

    下記のようにUser-Agentを取得し、 各キャリア別に振り分けているんですが、 ドコモ、kddi、PCはきちんと判定してそれぞれを 表示してくれますが、 ソフトバンク、ボーダフォン、j-phoneがうまく 判定してくれません。 ソフトバンクのソフト(ウェブコンテンツビューア)だと パソコン版が表示され、実際の携帯でみるとau画面が表示されて しまいます。 どなたかお力をおかしください。 <? $header = getallheaders(); $agent = $header["User-Agent"] ; if(ereg("DoCoMo",$agent)){ header("Location: http://www.aaa.com/mobi/i/index.html"); exit; } elseif(ereg("UP.Browser",$agent)){ header("Location: http://www.aaa.com/mobi/e/index.html"); exit; } elseif(ereg("SoftBank",$agent)){ header("Location: http://www.aaa.com/mobi/v/index.html"); exit; } elseif(ereg("Vodafone",$agent)){ header("Location: http://www.aaa.com/mobi/v/index.html"); exit; } elseif(ereg("J-PHONE",$agent)){ header("Location: http://www.aaa.com/mobi/v/index.html"); exit; } else{ header("Location: http://www.aaa.com/mobi/home.html"); exit; } ?>

    • ベストアンサー
    • PHP
  • Vodafone Live!でFLASHは見れますか?

    今仕事で、携帯キャリアの調査をしています。 DoCoMoとAUではFLASHが見れる機種がでていることはわかったのですが、Vodafoneのオフィシャルサイトを見てもいまいちよくわかりません。 ezweb http://www.au.kddi.com/ezweb/contents/mobile.html i-mode http://www.nttdocomo.co.jp/service/imode/site/ VodafoneでFLASHのサイトを見ることができる機種は出ているのでしょうか? ご存知の方がいらっしゃいましたら、教えてください。