I need a rewrite rule to redirect the root URL for a subfolder to the root of the domain, but I want to allow URLs in the subfolder. In other words:
Thanks!
Try this:
<configuration>
<location path="domain.com/subfolder">
<system.webServer>
<httpRedirect enabled="true" destination="http://domain.com" httpResponseStatus="Permanent" />
</system.webServer>
</location>
<location path="domain.com/subfolder/">
<system.webServer>
<httpRedirect enabled="true" destination="http://domain.com" httpResponseStatus="Permanent" />
</system.webServer>
</location>
</configuration>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.