Page is a not externally linkable
TurboCoder3000 - 8:25 am on Feb 28, 2013 (gmt 0)
I have two mobile websites - one for iPhone and one for iPad, 2 different designs stored in two different directories. I am trying to make it so that the following occurs. Unfortunately, just adding the two lines at the end of the RewriteCond code for iPad doesn't work.
1. When you visit on a phone device (iPhone, Android), the browser should go to: [mobile.example.com,...] which is the mobile site.
a. When you tap full website, it should go to the full site on the phone device.
2. When you visit the site on an iPad/Pad device, the browser should go to: http://www.example.com/mobile/ipad/
a. When you tap full website on the iPad, it should go to the full site http://www.example.com/ on the iPad device.
#Mobile detection
RewriteCond %{QUERY_STRING} !(.*&)?nomobile [NC]
RewriteCond %{REQUEST_URI} !\.*(jpg|png|css|this|that|otherthing)$ [NC]
RewriteCond %{HTTP_COOKIE} !^.*nomobile.*$ [NC]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} example\.com [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "dang|doco|eric|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]
RewriteCond %{HTTP_USER_AGENT} !macintosh [NC] #*SEE NOTE BELOW
RewriteRule ^(.*)$ http://mobile.example.com [L,R=302]
RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
RewriteRule ^(.*)$ http://www.example.com/mobile/ipad/ [R=301]