I am the proverbial "Least Common Denominator;" I have very little technical background and experience. So I'll apologize up-front for my seemingly elementary question(s) and I ask for your patience with me.
With that being said, the tera-WURFL project appears to be exactly what I'm looking for. My goal is to redirect my mobile visitor, when they visit my http://www.SITEURL.com to my http://www.m.SITEURL.com.
I've gone through the installation of tera-WURFL and it's up and running. At least on the back end.
I'm hitting a wall as to exactly where on my index.html page I put the script? Or for that matter, should I be using .html in the first place? Or should I be using a .php file as the index page?
Also, the example I saw at gotoandlearn.com shows the script being place ABOVE everything. As in, it starts on the first line. This is a little confusing to me as most of my experience tells me that this script should NOT go that high on the page, but if I'm wrong, so-be-it.
Here is the script I'm attempting to run:
- Code: Select all
<?php
require_once './TeraWurfl.php';
$wurflObj = new TeraWurfl();
$wurflObj->getDeviceCapabilitiesFromAgent();
// see if this client is on a wireless device
if($wurflObj->getDeviceCapability("is_wireless_device")){
header("Location: http://www.m.SITEURL.com/");
}
?>
Where SITEURL is my site.
Bottom line:
Where do I put the script?
Thanks,
IMSM