Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Mobile Marketing (https://www.warriorforum.com/mobile-marketing/)
-   -   Mobile redirect script with user agent detection (https://www.warriorforum.com/mobile-marketing/694439-mobile-redirect-script-user-agent-detection.html)

DavidMeade 15th October 2012 08:22 AM

Mobile redirect script with user agent detection
 
Hi,

I have a couple of mobile redirect scripts already. However I can't find one which allows me to single out iPads.

Some clients and leads are asking to have their main desktop website still show on iPads by default. I can do this with a screen size detection script but that's not really the best way to go.

Does anyone know of a mobile redirect script that will allow me to do this?

Regards,

Dave

Jay Moreno 15th October 2012 08:46 AM

Re: Mobile redirect script with user agent detection
 
1 Attachment(s)
Ours does that but its for Wordpress...

However if your site is php based you could do something like this on the desktop version:

Code:


for some reason it wont post so will add it as an attachment

Attachment 15193

obviously remove the "code" tags

Basically what this would does is detect if the visitor is viewing the site on an iPad.

If they are it will skip your redirect script if they are not it will run the redirect script based on its own parameters.

Using something like this will enable you to combine some of the other scripts you have used already.

Hope that helps

Cheers

Jay

DavidMeade 15th October 2012 02:42 PM

Re: Mobile redirect script with user agent detection
 
Hey Jay,

thanks for that. I'll test it shortly.

It's basically just saying if it's an ipad do nothing. Everything else it will process the redirect script which will figure out if it's a pc or mobile phone?

Not all of my clients have wordpress so this will be useful for them. Hopefully the product I currently use will have this option in future updates. If not then I will have to check out your wordpress plugin :)

Thanks again.

Dave

Jay Moreno 15th October 2012 03:29 PM

Re: Mobile redirect script with user agent detection
 
Quote:

Originally Posted by DavidMeade (Post 7173389)
Hey Jay,

thanks for that. I'll test it shortly.

It's basically just saying if it's an ipad do nothing. Everything else it will process the redirect script which will figure out if it's a pc or mobile phone?

Not all of my clients have wordpress so this will be useful for them. Hopefully the product I currently use will have this option in future updates. If not then I will have to check out your wordpress plugin :)

Thanks again.

Dave

you hit it nail on the nail - its using that conditional to see if its a ipad first and does absolutely nothing if it is - other wise as you mention the script runs and functions as it would do nomally... you can do something similar with javascript too - i just prefer php :)

Minista 15th October 2012 07:37 PM

Re: Mobile redirect script with user agent detection
 
HI! You can use this script. Tablet will show standard Website by defaul. The a javascript and php version of this script.

http:// blog.mobileesp.com/ ?page_id=20

We use this script in our commercial mobile Website software (Webelement) and it works perfectly.

Jay Moreno 15th October 2012 08:23 PM

Re: Mobile redirect script with user agent detection
 
Quote:

Originally Posted by Minista (Post 7174602)
HI! You can use this script. Tablet will show standard Website by defaul. The a javascript and php version of this script.

http:// blog.mobileesp.com/ ?page_id=20

We use this script in our commercial mobile Website software (Webelement) and it works perfectly.

does it allow returning visitors to come back to the main site and not get redirected and stuck in a loop? there's a lot of scripts out there that don't...

Jute 16th October 2012 03:59 AM

Re: Mobile redirect script with user agent detection
 
Also interested if it lets your visitor go to the main website and not getting auto-red to the mobile version again?

If not.... Then I would really appreciate if someone knew of a script (not plugin) that does that.

Thanks in advance!

Cheers

jspmedia 22nd December 2012 01:57 PM

Re: Mobile redirect script with user agent detection
 
anyone can share mobile redirect script here? I am using redirect javascript with screen width <=800..


All times are GMT -6. The time now is 01:44 AM.