I am trying to set up global mobile phone forwarding in my httpd.conf for all my sites on the server and only edit it once, compared to 92 times. All mobile sites are redirected to one location so that it is beautiful.
However, I want to exclude one specific URL from the redirect at all. Here is what I still have that does not work and causes a redirect loop:
RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^.*iphone|ipod|blackberry|android|sgh|sonyericsson|psp|mot|htc|lg|nokia|palm|treo|j2me|webos|smartphone|symbian.*$ [NC] RewriteCond %{REQUEST_URI} !^http://www.example.com/mobile [NC] RewriteRule ^(.*) http://www.example.com/mobile [R=302,L]
Can anyone understand why it causes a redirect loop at this particular url? This is just a folder in this htaccess domain containing only RewriteEngine off and an index.php file with a header () redirect call.
source share