简体   繁体   中英

iis url-rewrite for no script name

We would like to redirect IIS traffic with URL www.site1.com to www.site2.com . We do not want to redirect traffic for url's with either folder names and or script names. In other words we do NOT want to redirect a URL like www.site1.com/someFolder or www.site1.com/somePage.php , but if the URL is "plain" www.site1.com we want to redirect to www.site2.com .

You can try below rule:

<rule name="Redirect 1" enabled="true" stopProcessing="true">
    <match url="^$" />
    <conditions logicalGrouping="MatchAll">
    
    </conditions>
    <action type="Redirect" url="http://localhost:820/" appendQueryString="false" logRewrittenUrl="true" />
</rule>

you can set redirect URL based on your requirement

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM