Alex Stack
Alex Stack

Reputation: 51

Auto Redirect to Mobile Site

I want when a mobile device, (such as Android Phone; Tablet, iPad, iPhone, iPod, or any other mobile device) to redirect to the mobile site instead of the actual site, but I'm not sure how to do this.

In my case, the URL for my main site is super-short.freeoda.com and the mobile url is http://mobile.dudamobile.com/site/super-short_freeoda_2/

Upvotes: 0

Views: 315

Answers (1)

Lyza Gardner
Lyza Gardner

Reputation: 94

If you want to keep it quick and dirty, you might want to check out PHP Mobile Detect for simple mobile redirects. It does some basic categorization into mobile, tablet, and the main platforms (iOS, Android, BB, etc.) based on a well-crafted regex on User-Agent strings.

Taking it further, you can try device databases like WURFL or Device Atlas, but they're more heavy-weight.

To be conscientious, make sure to include a clear link back to the "full" or "desktop" site to account for possible mis-detections.

Upvotes: 0

Related Questions