iis 7 - IIS - Redirect all requests from one domain to a specific folder -
i have website configured on iis , multiple domains configured on hosts file point localhost.
my problem need redirect requests from: http://domain.com/folder/ http://domain.com/
so request http://domain.com/folder/test/image.jpeg should transformed into: http://domain.com/test/image.jpeg
i can't change files because i'm trying emulate cdn behavior.
can help?
thanks joao
using rewrite module, can go with:
<rule name="skip folder" stopprocessing="true"> <match url="^folder/(.*)$" /> <action type="redirect" url="{r:1}" /> </rule>
the default redirect permanent (301).
if want keep url http://domain.com/folder/test/image.jpeg
display content http://domain.com/test/image.jpeg
, rewrite has used:
<rule name="skip folder" stopprocessing="true"> <match url="^folder/(.*)$" /> <action type="rewrite" url="{r:1}" /> </rule>
Comments
Post a Comment