View Single Post
Old 09-08-2010, 10:57 AM  
kristin
GOO!
 
Industry Role:
Join Date: Sep 2002
Location: Back Home : )
Posts: 9,768
Already has your revid inserted - you can just use this and be ready to roll. I suggest using the htaccess especially because you have a large network of blogs you want to redirect.

------------------------------------------------------------------------------------------------

<?php
$REGULAR_URL = ''; // http://www.yourhomepage.com
$MOBILE_URL = 'http://www.ipinkvisualpass.com/?revid=61441';

// Do not edit below
$WORDS = array('mobile','android','blackberry','brew','htc' ,'j2me','lg','midp','mot','motorola','netfront','n okia','obigo','openweb','opera mini','palm','psp','samsung','sanyo','sch','sonyer icsson','symbian','symbos','teleca','up.browser',' vodafone','wap','webos','windows ce');
$is_mobile = FALSE;
foreach ($WORDS as $w)
{
if (isset($_SERVER['HTTP_USER_AGENT'])
&& strpos(strtolower($_SERVER['HTTP_USER_AGENT']), $w) !== false)
{
$is_mobile = TRUE;
break;
}
}
$url = ($is_mobile) ? $MOBILE_URL : $REGULAR_URL;
if (!empty($url))
{
header('Location: ' . $url);
}
?>

------------------------------------------------------------------------------------------------
<!--JAVASCRIPT MOBILE SITE REDIRECTION CODE-->
<script type="text/javascript">
MOBILE_URL = "http://www.ipinkvisualpass.com/?revid=61441";

// Do not edit below
var WORDS = ["mobile","android","blackberry","brew","htc","j2me ","lg","midp","mot","motorola","netfront","nokia", "obigo","openweb","opera mini","palm","psp","samsung","sanyo","sch","sonyer icsson","symbian","symbos","teleca","up.browser"," vodafone","wap","webos","windows ce"];
var WLEN = WORDS.length;
for (var i = 0; i < WLEN; i++)
{
var re = new RegExp(WORDS[i], "i");
if (re.exec(navigator.userAgent))
{
window.location = MOBILE_URL;
break;
}
}
</script>
------------------------------------------------------------------------------------------------
#HTACCESS MOBILE SITE REDIRECTION CODE
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|htc|j2me|lg|midp|m ot|motorola|netfront|nokia|obigo|openweb|opera.min i|palm|psp|samsung|sanyo|sch|sonyericsson|symbian| symbos|teleca|up.browser|vodafone|wap|webos|window s.ce) [NC]
RewriteRule ^(.*)$ http://www.ipinkvisualpass.com/?revid=61441 [R=302,L]
__________________
Vacares rules.

"Usually only fat guys have the kind of knowledge and ability that Kristin has."

Last edited by kristin; 09-08-2010 at 10:59 AM..
kristin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote