{"id":67,"date":"2011-08-07T18:25:35","date_gmt":"2011-08-07T17:25:35","guid":{"rendered":"http:\/\/www.vennercorp.com\/blog\/?p=67"},"modified":"2012-01-08T13:45:27","modified_gmt":"2012-01-08T12:45:27","slug":"how-to-automatically-redirect-visitors-to-your-mobile-website","status":"publish","type":"post","link":"http:\/\/www.vennercorp.com\/blog\/2011\/08\/07\/how-to-automatically-redirect-visitors-to-your-mobile-website\/","title":{"rendered":"How to automatically redirect visitors to your mobile website"},"content":{"rendered":"<p>So how do you automatically detect and then redirect your user to either you mobile site or your main site?<\/p>\n<p>It is very simple; the first thing to do is decide which mobile phones and tablets you are going to deal with. I would suggest you focus on the main 4 mobile phone operating systems and ignore the older ones as they are not worth the extra hassle. Tablets can also be ignored as they should be able to cope with your main site \u2013 unless you use flash and it\u2019s an apple tablet.<\/p>\n<p><em>The four main Mobile phones operating systems are Android, Blackberry, iOS (Apple), Windows and WebOS (HP\/Palm).<\/em><\/p>\n<p><strong>To implement the automatic redirect follow the steps below<\/strong><\/p>\n<p>1. Login into your web host via FTP and locate the root directory on your web server, this\u00a0 is normally where your index.htm file is located.<\/p>\n<p>2. Look for a file called \u201c.htaccess\u201d.<br \/>\nIf the \u201c.htaccess\u201d file is missing then create a blank file in notepad and use that. Remember the filename is just \u201c.htaccess\u201d there is no extension.<\/p>\n<p>3. Edit either the \u201c.htaccess\u201d file you downloaded or the new file you created and add the following lines.<br \/>\n\u2022 RewriteCond %{REQUEST_URI} !^\/ MOBILELOCATION \/.*$<br \/>\n\u2022 RewriteCond %{HTTP_USER_AGENT} &#8220;android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile&#8221; [NC]<br \/>\n\u2022 RewriteRule ^(.*)$ \/ MOBILELOCATION \/ [L,R=302]<\/p>\n<p>** change \u201cMOBILELOCATION\u201d with the location of your mobile site.<\/p>\n<p>4. Save your edited file and upload it to the root directory and test.<\/p>\n<p>Remember to backup your old htaccess file before uploading your new one encase anything goes wrong.<\/p>\n<p>If you need anymore information or help then please leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So how do you automatically detect and then redirect your user to either you mobile site or your main site? It is very simple; the first thing to do is decide which mobile phones and tablets you are going to deal with. I would suggest you focus on the main 4 mobile phone operating systems&hellip; <a class=\"more-link\" href=\"http:\/\/www.vennercorp.com\/blog\/2011\/08\/07\/how-to-automatically-redirect-visitors-to-your-mobile-website\/\">Continue reading <span class=\"screen-reader-text\">How to automatically redirect visitors to your mobile website<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68,57],"tags":[36,35,63,26],"class_list":["post-67","post","type-post","status-publish","format-standard","hentry","category-development","category-internet","tag-mobile-phone","tag-smart-phone","tag-webdesign","tag-website","entry"],"_links":{"self":[{"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/posts\/67","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/comments?post=67"}],"version-history":[{"count":4,"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions"}],"predecessor-version":[{"id":186,"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/posts\/67\/revisions\/186"}],"wp:attachment":[{"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/media?parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/categories?post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.vennercorp.com\/blog\/wp-json\/wp\/v2\/tags?post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}