I'm redirecting the iPhone (and soon to be more mobile devices) successfully but in combination with some preexisting rewrite rules in my .htaccess file it's causing too many redirects.
The mobile site is at mydomain.com/m and from mydomain.com it's trying to go to mydomain.com/m/?page=m&page=m&page=m&page=m etc.
I'm new to mod_rewrite and any help you could offer would be great!
Thanks!
Code:
### REDIRECT MOBILE DEVICES
RewriteCond %{HTTP_USER_AGENT} ^(.*iPhone.*)$
RewriteCond %{REQUEST_URI} !^/m
RewriteRule ^(.*)$ /m [L]
### OTHER REQUIRED REWRITE RULES BELOW
### CHECK FOR TRAILING SLASH - Will ignore files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /$1/ [L,R=301]
### MAIN REWRITE - This will ignore directories
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\/$ /index.php?page=$1&%{QUERY_STRING} [L]