{"id":2860,"date":"2012-06-20T05:53:10","date_gmt":"2012-06-20T09:53:10","guid":{"rendered":"http:\/\/www.mccordweb.com\/weblogs\/?p=2860"},"modified":"2012-06-16T10:02:39","modified_gmt":"2012-06-16T14:02:39","slug":"mobile-website-redirection-tactics","status":"publish","type":"post","link":"https:\/\/www.mccordweb.com\/weblogs\/2012\/06\/20\/mobile-website-redirection-tactics\/","title":{"rendered":"Mobile Website Redirection Tactics"},"content":{"rendered":"<p>I recently have been testing out mobile website design. Although there are some great free tools out there that automatically make a mobile website for you, I simply did not want THAT much content on my mobile site. I wanted a streamlined small interface with just my key services and phone links. PLUS I wanted the website files to reside on MY server, not over at Bing Local or over at Dudamobile.com.<\/p>\n<p>I found a template at Dreamweaver to help me used JQuery to create a mobile website. <a href=\"http:\/\/www.adobe.com\/devnet\/dreamweaver\/articles\/dw-template-jqmobile.html\">You can check out the video and grab the files here.<\/a>\u00a0I was able to pretty easily customize the site and CSS, but really ran into a problem getting the site to show for mobile users.<\/p>\n<p>Typically a &#8220;sniffing&#8221; script will be used to deliver content for mobile phones, but the scripts I found simply did not work. My Android smartphone still saw my desktop website. I found that the CSS declaration that identifies screen width and then redirects the used did not work for me, nor did several other php scripts. I ended up using a .htaccess redirect.<\/p>\n<p>This is the code I used in the .htaccess file:<\/p>\n<p># mobile site redirection<br \/>\nRewriteCond %{HTTP_REFERER} !^http:\/\/(.*).mccordweb.com\/.*$ [NC]<br \/>\nRewriteCond %{REQUEST_URI} !^\/mobile\/.*$<br \/>\nRewriteCond %{HTTP_USER_AGENT} &#8220;android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile&#8221; [NC]<br \/>\nRewriteRule ^(.*)$ \/mobile\/ [L,R=302]<\/p>\n<p>This worked for me. You can check out my mobile site at <a href=\"http:\/\/www.mccordweb.com\/mobile\/\">http:\/\/www.mccordweb.com\/mobile\/<\/a>\u00a0but you&#8217;ll only see if on your smartphone, don&#8217;t got there with your browser. Mine is still a work in progress, but something that I am testing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently have been testing out mobile website design. Although there are some great free tools out there that automatically make a mobile website for you, I simply did not want THAT much content on my mobile site. I wanted a streamlined small interface with just my key services and phone links. PLUS I wanted the website files to reside on MY server, not over at Bing Local or over at Dudamobile.com. I found a template at Dreamweaver to help me used JQuery to create a mobile website. You can check out the video and grab the files here.\u00a0I was able to pretty easily customize the site and CSS, but really ran into a problem getting the site to show for mobile users. Typically a &#8220;sniffing&#8221; script will be used to deliver content for mobile phones, but the scripts I found simply did not work. My Android smartphone still saw my desktop website. I found that the CSS declaration that identifies screen width and then redirects the used did not work for me, nor did several other php scripts. I ended up using a .htaccess redirect. This is the code I used in the .htaccess file: # mobile site redirection RewriteCond %{HTTP_REFERER} !^http:\/\/(.*).mccordweb.com\/.*$ [NC] RewriteCond %{REQUEST_URI} !^\/mobile\/.*$ RewriteCond %{HTTP_USER_AGENT} &#8220;android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile&#8221; [NC] RewriteRule ^(.*)$ \/mobile\/ [L,R=302] This worked for me. You can check out my mobile site at http:\/\/www.mccordweb.com\/mobile\/\u00a0but you&#8217;ll only see if on your smartphone, don&#8217;t got there with your browser. Mine is still a work in progress, but something that I am testing.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[271],"class_list":["post-2860","post","type-post","status-publish","format-standard","hentry","category-web-design","tag-website-design"],"_links":{"self":[{"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/posts\/2860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/comments?post=2860"}],"version-history":[{"count":1,"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/posts\/2860\/revisions"}],"predecessor-version":[{"id":2861,"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/posts\/2860\/revisions\/2861"}],"wp:attachment":[{"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/media?parent=2860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/categories?post=2860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mccordweb.com\/weblogs\/wp-json\/wp\/v2\/tags?post=2860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}