Transparently rewrite requests to a subdomain.
        Posted  
        
            by 
                ptrin
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by ptrin
        
        
        
        Published on 2011-01-05T15:47:41Z
        Indexed on 
            2011/01/05
            15:55 UTC
        
        
        Read the original article
        Hit count: 259
        
iis
|url-rewriting
I would like to rewrite requests to http://www.mysite.com/foo to http://foo.mysite.com without the user's address bar changing. Using IIRF I can do the rewrite, but only if I use the [R] modifier flag which makes the rewrite a redirect. Is there a way for me to transparently rewrite requests to a subdomain?
Here's the rewrite rule I've been testing with:
RewriteRule ^/foo/(.*)?$ http://foo.mysite.com/index.html?$1 [R,L]
        © Server Fault or respective owner