<div><div>I have this ugly rewrite rule that works to redirect mobile browsers to a mobile page. I tried inverting the logic and making it redirect desktop browsers to the non-mobile site. I thought it was working but as I moved to a new server it is either no longer working or it never was.</div>

</div><div><br></div><div>This works and sends mobiles to the right place:</div><div><div>RewriteCond %{REQUEST_URI} ^/$</div><div>RewriteCond %{HTTP_USER_AGENT} !ELB-HealthChecker [NC]</div><div>RewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]</div>

<div>RewriteCond %{HTTP_USER_AGENT} "acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC,OR]</div><div>RewriteCond %{HTTP_USER_AGENT} "dang|doco|erics|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC,OR]</div>

<div>RewriteCond %{HTTP_USER_AGENT} "maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC,OR]</div><div>RewriteCond %{HTTP_USER_AGENT} "palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC,OR]</div>

<div>RewriteCond %{HTTP_USER_AGENT} "sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC,OR]</div><div>RewriteCond %{HTTP_USER_AGENT} "teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC,OR]</div>

<div>RewriteCond %{HTTP_USER_AGENT} "wapp|wapr|webc|winw|winw|xda|xda-" [NC,OR]</div><div>RewriteCond %{HTTP_USER_AGENT} "up.browser|up.link|windowssce|iemobile|mini|mmp" [NC,OR]</div><div>RewriteCond %{HTTP_USER_AGENT} "symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]</div>

<div>RewriteRule ^(.*)$ <a href="http://mysite.com/">http://mysite.com/</a> [L,R=302]</div></div><div><br></div><div>This isn't:</div><div><div>RewriteCond %{REQUEST_URI} ^/$</div><div>RewriteCond %{HTTP_ACCEPT} !"text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC]</div>

<div>RewriteCond %{HTTP_USER_AGENT} !"acs|alav|alca|amoi|audi|aste|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-" [NC]</div><div>RewriteCond %{HTTP_USER_AGENT} !"dang|doco|erics|hipt|inno|ipaq|java|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-" [NC]</div>

<div>RewriteCond %{HTTP_USER_AGENT} !"maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|opwv" [NC]</div><div>RewriteCond %{HTTP_USER_AGENT} !"palm|pana|pant|pdxg|phil|play|pluc|port|prox|qtek|qwap|sage|sams|sany" [NC]</div>

<div>RewriteCond %{HTTP_USER_AGENT} !"sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo" [NC]</div><div>RewriteCond %{HTTP_USER_AGENT} !"teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|w3cs|wap-|wapa|wapi" [NC]</div>

<div>RewriteCond %{HTTP_USER_AGENT} !"wapp|wapr|webc|winw|winw|xda|xda-" [NC]</div><div>RewriteCond %{HTTP_USER_AGENT} !"up.browser|up.link|windowssce|iemobile|mini|mmp" [NC]</div><div>RewriteCond %{HTTP_USER_AGENT} !"symbian|midp|wap|phone|pocket|mobile|pda|psp" [NC]</div>

<div>RewriteRule ^(.*)$ <a href="http://www.mysite.com/">http://www.mysite.com/</a> [L,R=302]</div></div><div><br></div><div>Any idea what I'm missing?</div><div><br></div><div>-- <br>Matthew Nuzum<br>newz2000 on freenode, skype, linkedin and twitter<br>

<br><p>







</p><p><span>♫</span> You're never fully dressed without a smile! <span>♫</span></p><p></p><br>
</div>