Hi there,
We receive a lot of mobile specific traffic so are working on setting up a redirect in .htaccess from homepage to mobile homepage. The full codebase in our .htaccess is:
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (^|&)m=0(&|$)
RewriteRule ^ – [CO=mredir:0:http://www.maindomain.com]
RewriteCond %{HTTP_HOST} !^http://www.maindomain.com/mobile/\\.com$ [NC]
RewriteCond %{REQUEST_URI} !\\.(jpg|css|png|gif)$ [NC]
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
RewriteCond %{QUERY_STRING} !(^|&)m=0(&|$) [NC]
RewriteCond %{HTTP_COOKIE} !mredir=0 [NC]
RewriteRule ^ http://www.maindomain.com/mobile/? [R,L]
Where maindomain.com is our main site and maindomain.com/mobile-site/ is where we want the redirect to go.
The issue we’re having is that Safari is giving us a ‘too many redirects’ error. Just tested in Chrome on iPhone 4 and the error code is: ERR_TOO_MANY_Redirects
Any help would be appreciated!