Website Mobile Redirection Using .htaccess Script

Here is a simple way to redirect visitors to the mobile version of your website using .httaccess. Read and learn .htaccess redirection tutorial on mobile devices. This website .httaccess trick is pretty useful if your site visitor is currently using a mobile phone to browse on your site. While sometimes navigating to a site which has no mobile version is pretty discouraging as you have to continually zoom in or zoom out, depending on the site’s navigation bars and size of text, this .httaccess script might do the trick.

Note that this method is used if you already have a current mobile version of your website. Read on and learn how to use this .htaccess script to redirect your mobile visitors to your mobile version of your site.


Steps by step method for mobile redirection using .htaccess script

1. Open your .httaccess file. (If you do not have an existing one, you could create it. Open a text editor and save it as .htaccess.)

2. Copy and paste the code below to your .htaccess file. (Change to your mobile website url.)

RewriteEngine On
 RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|cldc|docomo|htc|j2me|micromax|lg|midp|mot|motorola|netfront|nokia|obigo|openweb||palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windows.ce) [NC]
 RewriteRule ^(.*)$ [R=302,L]

3. Save your .htaccess file.

4. Test it using your mobile phone.

If steps are done correctly, you now should be able to see the mobile version of your website. Setting up a mobile version of your website is a good trick in boosting traffic to your site. With the help of technology, more and more people now browse on the mobile devices, and using this trick will certainly help you and your visitors as well. Hope this website mobile redirection using .htaccess script helped you somehow.

Like our Facebook Fan Page.

Subscribe and get the latest tips, tricks, news, and updates delivered straight to your e-mail inbox.

Enter your email address:

Delivered by FeedBurner


Ameer is your techie friend, the head admin, and editor-in-chief of this blog. In here we share the latest technology news and updates, computer tips and tricks, SEO, games and gaming news, and other tech articles that aims to help you with today's technology.


Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe to mailing list and download the content.
  We hate SPAM and promise to keep your email address safe.
Disclaimer: You are being added to a mailing list which you can unsubscribe at any time.
Read previous post:
How to Run Android Apps on Mac, Linux and Windows

Run and install Android apps on Mac, Linux or Windows computers through ARChon , a modified version of Google’s App...