Thanks, Chris, for the tip about the RewriteLog. I've got LogLevel set to 3. I'm getting this output for the url / when my desktop browser hits the mobile site:<div><br></div><div><br></div><div><div>I didn't include that there there were two blocks of rules. The RewriteLog shows that the first block is getting processed and the second isn't. Am I missing something? Here are the rules, the log is below:</div>

</div><div><br></div><div><div>RewriteEngine On</div><div>RewriteCond %{HTTP_USER_AGENT} !ELB-HealthChecker [NC]</div><div>RewriteCond %{HTTP_HOST} !^xyz\.com [NC]</div><div>RewriteCond %{HTTP_HOST} !^$</div><div>RewriteRule ^/(.*) <a href="http://xyz.com/$1">http://xyz.com/$1</a> [L,R=302]</div>

<div><br></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>#RewriteCond %{HTTP_USER_AGENT} macintosh [NC]</div><div>RewriteRule ^$ <a href="http://www.xyz.com/">http://www.xyz.com/</a> [L,R=302]</div>

</div><div><br></div><div>LOG: (level 9)</div><div><br></div><div><div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial</a>] (2) init rewrite engine with requested uri /</div>

<div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial</a>] (3) applying pattern '^/(.*)' to uri '/'</div>

<div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial</a>] (4) RewriteCond: input='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1' pattern='!ELB-HealthChecker' [NC] => matched</div>

<div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial</a>] (4) RewriteCond: input='<a href="http://xyz.com">xyz.com</a>' pattern='!^xyz\.com' [NC] => not-matched</div>

<div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial</a>] (3) applying pattern '^$' to uri '/'</div>

<div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce425448/initial</a>] (1) pass through /</div><div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce42b478/subreq">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce42b478/subreq</a>] (2) init rewrite engine with requested uri /</div>

<div>10.245.185.231 - - [10/Aug/2011:22:52:02 +0000] [<a href="http://xyz.com/sid#7f46ce1d5bd0][rid#7f46ce42b478/subreq">xyz.com/sid#7f46ce1d5bd0][rid#7f46ce42b478/subreq</a>] (1) pass through /</div></div><div><br></div>

<div><br><div class="gmail_quote">On Tue, Aug 9, 2011 at 1:08 PM, Matthew Nuzum <span dir="ltr"><<a href="mailto:newz@bearfruit.org">newz@bearfruit.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<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/" target="_blank">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/" target="_blank">http://www.mysite.com/</a> [L,R=302]</div></div><div><br></div><div>Any idea what I'm missing?</div><div><br></div><font color="#888888"><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>
</font></blockquote></div><br><br clear="all"><br>-- <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>