title: Serving static content from a subdomain in asp.net using URL Rewrite
body: <p>Searched for a few hours with no avail so here goes...</p>
  
  <p>I have a domain which is receiving quite a few hits per day and have been asked if I can serve the static content from a subdomain. As the site is quite extensive and already written, I was wondering if there is any way I can use URL rewriting to change:</p>
  
  <p>www.example.com/image.gif </p>
  
  <p>to </p>
  
  <p>static.example.com/image.gif</p>
  
  <p>I have a solution which works using 301 redirects but from what I understand, this is counter productive as 2 requests will have to be made per image. I don't really want to go through all the aspx pages and css to hard code the new url as it will cause problems further down the line - some parts of the site are still being developed and static content could change at any time. I tried using rewrite (as opposed to redirect) to change the url but it came out something like:</p>
  
  <p><a href="http://www.example.com/http://static.example.com/image.gif" rel="nofollow">http://www.example.com/http://static.example.com/image.gif</a></p>
  
  <p>How would you achieve this? I have full access to dns and the server (win 2008r2 / IIS 7.5) so can make any changes if url rewriting is not the answer.</p>
  
  <p>Thanks in advance</p>
  
  <p>Tom.</p>