How to redirect mobile devices to mobile website?

jackson

Does anyone know a good guide for how to detect and redirect website visitors that are using mobile devices/browsers?

Answer this Question

Answers

3 total
Christopher Nerney
Vote Up (12)

This one, from InMotionHosting.com, covers several options:

 

To redirect a mobile visitor, you'll need to determine if their browser is a web browser on a mobile device or not. You can determine which browser the visitor is using. ...

 

If you are running a Content Management System (such as WordPress or Joomla), there may be plugins already available that help with handling mobile visitors. ...

 

Because mobile phones typically have a small screen width, you can redirect visitors to your mobile site if they have a screen width of less than or equal to 800 pixels. Place Javascript window.location code in the head section of your main website code. That way when your site is visited, the javascript will see the browser width and redirect to the appropriate site. ...

 

You can use a .htaccess redirect to transfer visitors based upon the MIME types the browser supports. For example, if the user's browser accepts mime types that include WML (Wireless Markup Language), then most likely it is a mobile device. The code below should be placed in your .htaccess file.

 


 

 

jimlynch
Vote Up (11)

If you're using WordPress, try the Jetpack plugin. That comes with a free mobile version that you can enable. Anybody on a phone will see the mobile version automatically.

http://wordpress.org/extend/plugins/jetpack/

Ask a question

Join Now or Sign In to ask a question.
From sign-on bonuses to long-term equity bonus incentives to perks such as paying for the lease on a new Tesla, firms are upping the ante to attract and hire elite software development talent in a tight market.
Ryan Carmack, the 9 year-old son of the famed programmer and game designer, has released Pong-clone called Angry Face
Traditional development practices used for desktop apps will not work for mobile apps, and companies must instead adopt agile development, says analyst Gartner.
A new study reveals that Java developers make the most while JavaScript programmers are the most wanted
Mark Zuckerberg’s latest app takes onerous Terms of Service to a strange new level
Using a combination of Jenkins and Circle CI, plus some Ruby and GitHub know-how, will make for a smooth process.
Want to offer extra functionality to your users based on where they are? Here's how.
With competition being as intense as ever, Google is attempting to distinguish its cloud offering by appealing directly to developers.
New data from AngelList shows the top technology choices that startups are making
GitHub has been called the 'social network for programmers.' Here's how to get started on the popular site for sharing and hosting code (and other things).