Rovi31
asked on
IIS7 URL rewrite map to other external domain
I have a website in which the map "/img" must be redirected to another domain. The other domain can be an external one.
so "http://www.mydomain.com/img/test/demo.jpg" must be redirected to "http://www.otherdomain.com/img/test/demo.jpg"
i also have a <base href="http://www.mydomain.com/">, so the URL to be redirected will be most of the time "img/test/demo.jpg ", which then also should be redirected to to "http://www.otherdomain.com/img/test/demo.jpg"
i currently have this, but it doesn't work
How can i do that (in the web.config)
Thanks.
so "http://www.mydomain.com/img/test/demo.jpg" must be redirected to "http://www.otherdomain.com/img/test/demo.jpg"
i also have a <base href="http://www.mydomain.com/">, so the URL to be redirected will be most of the time "img/test/demo.jpg ", which then also should be redirected to to "http://www.otherdomain.com/img/test/demo.jpg"
i currently have this, but it doesn't work
<rewrite>
<rules>
<rule name="Change image linking" stopProcessing="false">
<match url=".*\.(gif|jpg|png)$" />
<conditions>
<add input="{HTTP_HOST}" pattern="img/(.*)$" />
</conditions>
<action type="Redirect" url="http://www.otherdomain.com/{C:1}" appendQueryString="false" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
How can i do that (in the web.config)
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.