title: Redirect everything except images
body: <p>I cant understand why but:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} market\.mysite\.com$ [NC]
  RewriteCond %{HTTP_HOST} !^market\.mysite\.com$ [NC]
  RewriteCond %{REQUEST_URI} \.(png|jpe?g|bmp|gif|swf|css|js)$ [NC]
  RewriteRule ^(.*) http://market.mysite.com/$1 [L,R]
  
  RewriteCond %{REQUEST_URI} !^/index\.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php [L]
  </code></pre>
  
  <p>Works as expected. Redirecting images to an other domain. But this one:</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} market\.mysite\.com$ [NC]
  RewriteCond %{HTTP_HOST} !^market\.mysite\.com$ [NC]
  RewriteCond %{REQUEST_URI} !\.(png|jpe?g|bmp|gif|swf|css|js)$ [NC]
  RewriteRule ^(.*) http://market.mysite.com/$1 [L,R]
  
  RewriteCond %{REQUEST_URI} !^/index\.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php [L]
  </code></pre>
  
  <p>Will redirect all no matter what. What I want to see is to redirect all except images.
  What I am trying to do in my rules above is to redirect all sub-domains of market.mysite.com to market.mysite.com if it wasn't market.mysite.com and if it wasn't an image. In another word:</p>
  
  <pre><code>cdn.market.mysite.com -&gt; market.mysite.com
  
  cdn.market.mysite.com/blahblah.html -&gt; market.mysite.com/blahblah.html
  
  cdn.market.mysite.com/blahblah.png -&gt; NO REDIRECT
  
  market.mysite.com -&gt; NO REDIRECT
  </code></pre>
  
  <p>I use wildcard sub-domain so all of my market sub-sub-domains will use same directory. And then responding to all of requests by one php file. index.php</p>
  
  <p>Thanks,</p>