简体   繁体   中英

Redirect file to folder in web.config

having a bit of trouble here, I'm working on a web.config file to perform a URL redirect from a file to a folder. I have the following:

<rule name="redirect fleet/cats.asp" stopProcessing="true">
    <match url="^fleet/cats.asp$" ignoreCase="false" />
    <action type="Redirect" redirectType="Permanent" url="http://www.ccy.com.au/availability/{R:1}" />
</rule>

Which redirects: /fleet/cats.asp to /availability/cats.asp

What I want to achieve is:

/fleet.cats.asp to /availability/

What am I missing to achieve this? Any help would be greatly appreciated, thank you in advance!

I found that I had to remove {R:1} on the action attribute. that way I can redirect from a page to a directory. Thanks me!

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