wif this script u put it in ur base folder and it will redirect xhtml browsers and pcs to web version and older phones to wml version jus put ur link in there for web n wap folder
<?php
global $userBrowser;
// Your wapsite
$wmllink = "http://siteaddress.com/wap/index.php";
// Your website
$htmllink = "http://siteaddress.com/web/index.php";
//Detect the browser
$userBrowser = $_SERVER['HTTP_USER_AGENT'];
//echo $userBrowser;
if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+ XML") > 0)
{
$ub="PC";
}
else if(strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)
{
$ub="PC";
}
//Check for Mozilla
else if(stristr($userBrowser, 'Mozilla'))
{
$ub="PC";
}
//Check for msie
else if(stristr($userBrowser, 'msie'))
{
$ub="PC";
}
//Check for IE
else if(stristr($userBrowser, 'internet explorer'))
{
$ub="PC";
}
//Check for opera
else if(stristr($userBrowser, 'opera'))
{
$ub="PC";
}
//Check for Opera
else if(stristr($userBrowser, 'Opera'))
{
$ub="PC";
}
else
{
$ub="WML";
}
if($ub == "PC") {
header("Location: ".$htmllink);
exit;
}
else
{
header("Location: ".$wmllink);
exit;
}
?>
<?php
global $userBrowser;
// Your wapsite
$wmllink = "http://siteaddress.com/wap/index.php";
// Your website
$htmllink = "http://siteaddress.com/web/index.php";
//Detect the browser
$userBrowser = $_SERVER['HTTP_USER_AGENT'];
//echo $userBrowser;
if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+ XML") > 0)
{
$ub="PC";
}
else if(strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)
{
$ub="PC";
}
//Check for Mozilla
else if(stristr($userBrowser, 'Mozilla'))
{
$ub="PC";
}
//Check for msie
else if(stristr($userBrowser, 'msie'))
{
$ub="PC";
}
//Check for IE
else if(stristr($userBrowser, 'internet explorer'))
{
$ub="PC";
}
//Check for opera
else if(stristr($userBrowser, 'opera'))
{
$ub="PC";
}
//Check for Opera
else if(stristr($userBrowser, 'Opera'))
{
$ub="PC";
}
else
{
$ub="WML";
}
if($ub == "PC") {
header("Location: ".$htmllink);
exit;
}
else
{
header("Location: ".$wmllink);
exit;
}
?>
Comment