We can direct people to our mobile site using JavaScript. What this following code does is look for a screen size and then redirects the user.
[code]
<script type="text/javascript">
if (screen.width <= 699) {
document.location = "mymobilesite.html";
}[/code]
The following code will target iPhone and iPods to your mobile website.
[code]
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
location.replace("http://m/mywebsite.com");
}
</script>[/code]
Put this link code in your header so that Google knows where your mobile site is located.
[code]<link rel="alternate" href="http://mywebsite/mobile/" media="only screen and (max-width: 640px)">[/code]
More detailed redirects in JavaScript
[code]<script type="text/javascript">
var getStr = window.location.search.substr(1);
var getArray = getStr.split ("&");
var get = {};
for ( var i = 0; i < getArray.length; i++) {
var tmpArray = getArray[i].split("=");
get[tmpArray[0]] = tmpArray[1];
}
if (get.m == "yes") {
window.location = "http://m.example.com"
}
else if (get.m == "no") {
window.location = "http://www.example.com";
}
[/code]
Redirect to Mobile site using PHP
[code]<?php if(strstr($_SERVER[‘HTTP_USER_AGENT’],’iPhone’) || strstr($_SERVER[‘HTTP_USER_AGENT’],’iPod’))
{
header(‘Location: http://yoursite.com/iphone’);
exit();
}?>[/code]


A1WEBSITEPRO Social Media Pages
Here are my social media pages, lets hook up!