Newbie needs help with single page mobile redirect script

I have this HTTP request, I expected this, but WURFL is returning that. Please provide enough data to reproduce the problem.
johncpatterson
Posts: 2
Joined: Wed Sep 25, 2013 8:42 pm

Newbie needs help with single page mobile redirect script

Postby johncpatterson » Wed Sep 25, 2013 8:45 pm

Hi all,

I have been doing a lot of research on how to redirect a single page from my WordPress website to a mobile version (I would like to redirect all mobile users who visit http://lifebyjohn.com/schedule to http://lifebyjohn.com/mobile-schedule, I do not want to redirect all mobile users for all my pages to a different page or theme, only just a single page).

However, I have yet to find a plugin that can do this. I've seen a few "scripts" around the internet, most notably WURFL or http://www.detectmobilebrowsers.com, but I don't know the code to enter into my "head" in order to redirect the page correctly.

In any event, I'm just looking for an easy way to get a mobile device redirect going for my single page, hopefully through a method that continually "updates" itself like http://www.detectmobilebrowsers.com or WURFL.

Any help would be most appreciated!

- John

sm_support2
Posts: 294
Joined: Mon Jun 20, 2011 5:04 pm

Re: Newbie needs help with single page mobile redirect scrip

Postby sm_support2 » Thu Sep 26, 2013 7:55 am

It seems to me that our Cloud is what you are looking for:

http://www.scientiamobile.com/wurflCloud/gettingStarted

based on your description, the free Cloud offer might suffice for your goals.

johncpatterson
Posts: 2
Joined: Wed Sep 25, 2013 8:42 pm

Re: Newbie needs help with single page mobile redirect scrip

Postby johncpatterson » Thu Sep 26, 2013 5:09 pm

Hi there,

From the look of things it might very well work, however I must admit that as a newbie I'm pretty lost. I got the API, chose the capability I needed (mobile_os), downloaded the cloud client, but that's pretty much all I know how to do at this point. Is there any kind of script or instructions you can provide me as to how to achieve what I'm looking for above?

Thanks!

sm_support2
Posts: 294
Joined: Mon Jun 20, 2011 5:04 pm

Re: Newbie needs help with single page mobile redirect scrip

Postby sm_support2 » Thu Sep 26, 2013 7:47 pm

I modified the example we have in the Getting Started slightly (see below) to apply even more closely to your case (header('Location:url') is your friend). If this is not enough, please write your address here. I will jump on a plane and come to you and fix it for you. How does that sound?

Code: Select all

<?php
// Include the WURFL Cloud Client
// You'll need to edit this path
require_once '../Client/Client.php';
 
// Create a configuration object 
$config = new WurflCloud_Client_Config(); 
 
// Set your WURFL Cloud API Key 
$config->api_key = 'xxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';  
 
// Create the WURFL Cloud Client 
$client = new WurflCloud_Client_Client($config); 
 
// Detect your device 
$client->detectDevice(); 
 
// Use the capabilities 
if ($client->getDeviceCapability('ux_full_desktop')) { 
 header('Location: http://www.company.com/web');
} else {  
 header('Location: http://www.company.com/mobile');
}
Last edited by kamermans on Thu Sep 26, 2013 8:35 pm, edited 1 time in total.
Reason: Added code block for readability

balmerhevi
Posts: 1
Joined: Thu Nov 10, 2016 2:50 am

Re: Newbie needs help with single page mobile redirect scrip

Postby balmerhevi » Thu Nov 10, 2016 2:51 am

The following Javascript code will help you to redirect to your mobile version.

<script type="text/javascript">
if (screen.width <= 699) {
document.location = "mobile/mobilepage.html";
}
</script>

More....Mobile Redirect

Hevi


Who is online

Users browsing this forum: No registered users and 1 guest