troubleshooting Question

IIS7 URL rewrite map to other external domain

Avatar of Rovi31
Rovi31Flag for Netherlands asked on
Microsoft IIS Web ServerASP.NET
1 Comment1 Solution2252 ViewsLast Modified:
I have a website in which the map "/img" must be redirected to another domain. The other domain can be an external one.

so "" must be redirected to ""

i also have a <base href="">, so the URL to be redirected will be most of the time "img/test/demo.jpg ", which then also should be redirected to to ""

i currently have this, but it doesn't work

     <rule name="Change image linking" stopProcessing="false">  
        <match url=".*\.(gif|jpg|png)$" />  
             <add input="{HTTP_HOST}" pattern="img/(.*)$" />  
      <action type="Redirect" url="{C:1}" appendQueryString="false" redirectType="Permanent" />  

How can i do that (in the web.config)

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros