Quote:
Originally Posted by geoGUERILLA
We have the script in our member section or just send the traffic to us and we filter it for you.
|
HTACCESS MOBILE SITE REDIRECTION CODE
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (mobile|blackberry|webos|android|j2me|palm|nokia|s amsung|symbian|windows.ce) [NC]
RewriteRule ^(.*)$
http://www.nakednewsanchors.com/nnmobile1/?nnid=XXXX [R=302,L]M
PHP
<?php
//define for php4
if (function_exists('stripos') === false) {
function stripos($mystring,$findme,$offset = 0){
$mystring = strtolower($mystring);
$findme = strtolower($findme);
$pos = strpos($mystring,$findme,$offset);
return $pos;
}
}
mobileRedirect(1);
function mobileRedirect($enabled){
if(!$enabled){return;}
$nnid = XXXX;
$mobileAgents = array('mobile', 'blackberry', 'j2me', 'windows ce');
$IPHONE_URL = "http://www.nakednewsanchors.com/nnmobile1/?nnid=$nnid";
$ANDROID_URL = "http://www.nakednewsanchors.com/nnmobile1/?nnid=$nnid";
$MOBILE_URL = "http://www.nakednewsanchors.com/nnmobile1/?nnid=$nnid";
if (isset($_SERVER['HTTP_USER_AGENT'])){
if(stripos($_SERVER['HTTP_USER_AGENT'], "iphone") !== false){
header('Location: ' . $IPHONE_URL);
exit;
}
else if (stripos($_SERVER['HTTP_USER_AGENT'], "android") !== false){
header('Location: ' . $ANDROID_URL);
exit;
}
else {
foreach ($mobileAgents as $w){
if (stripos($_SERVER['HTTP_USER_AGENT'], $w) !== false){
header('Location: ' . $MOBILE_URL);
exit;
}
}
}
}
}
JAVA
match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("http://www.nakednewsanchors.com/nnmobile1/?nnid=XXXX");
//iphone ipod redirect
}
else if ((navigator.userAgent.match(/android/i))) {
location.replace("http://www.nakednewsanchors.com/nnmobile1/?nnid=XXXX");
// android redirect
}
else if ((navigator.userAgent.match(/nokia/i)) || (navigator.userAgent.match(/symbian/i))) {
location.replace("http://www.nakednewsanchors.com/nnmobile1/?nnid=XXXX");
//nokia redirect
}
else if ((navigator.userAgent.match(/webos/i)) || (navigator.userAgent.match(/palm/i))) {
location.replace("http://www.nakednewsanchors.com/nnmobile1/?nnid=XXXX");
//palm Webos redirect
}
</script>