MT4i

ケータイからもこのBlogが見えます。投稿とかもできるんかな?
mobile version


さらに、PHPで振り分けてみました。
Nao’s PukiWikiさんを参考にしました。
前提はPHPが動いていることです。
<?php phpinfo();?>という内容のファイル(ファイル名は何でもよい)をつくり、アクセスしPHPの状況が見えれば動いています。
次に、メインテンプレートをindex.phpに変更します。httpd.confか.htaccessで、DirectoryIndexにindex.phpを指定し、URLの変更なしでindex.phpを読んでくれるようにします。
今までのindex.htmlはいらないので削除します。
MTの管理画面の「テンプレート」にアクセスし、メインインデックスを編集します。
デフォルトでは出力ファイルがindex.htmlになっているので、index.phpに変更し、以下をテンプレートの最初にそのままペースト。

$ua = $_SERVER["HTTP_USER_AGENT"];
if(ereg("DoCoMo",$ua)){
header("Location: http://uep.hayate.mine.nu/mt4i.cgi");
exit;
}elseif(ereg("J-PHONE",$ua)){
header("Location: http://uep.hayate.mine.nu/mt4i.cgi");
exit;
}elseif(ereg("UP\.Browser",$ua)){
header("Location: http://uep.hayate.mine.nu/mt4i.cgi");
exit;
}elseif(ereg("PDXGW",$ua)){
header("Location: http://uep.hayate.mine.nu/mt4i.cgi");
exit;
}elseif(ereg("DDIPOCKET",$ua)){
header("Location: http://uep.hayate.mine.nu/mt4i.cgi");
exit;
}elseif(ereg("Vodafone",$ua)){
header("Location: http://uep.hayate.mine.nu/mt4i.cgi");
exit;
}

もちろん、< ?php ~ ?>も忘れずに。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です