简体   繁体   English

IIS7重写模块

[英]IIS7 rewrite module

I got a problem with IIS 7 rewrite module rule我遇到了 IIS 7 重写模块规则的问题

I want it to change any url from below format:我希望它从以下格式更改任何 url:

http://www.mysite.com/files/2010/04/background6.jpg http://www.mysite.com/files/2010/04/background6.jpg

to new url like this: http://www.mysite.com/= "/wp-includes/ms-files.php?file=2010/04/background6.jpg到新的 url 像这样: http://www.mysite.com/= "/wp-includes/ms-files.ZE1BFD762321E409CEE4AC0B6E84101/04/background6.jpg

I added a rule to web.config我在 web.config 中添加了一条规则

<rule name="Avatar">
    <match url="^/files/(.*)$" />
     <action type="Rewrite" url="/wp-includes/ms-files.php?file={R:1}" />
</rule>

but it does not work, it takes me forever to debug it.但它不起作用,我需要永远调试它。

any helps?有什么帮助吗?

thanks you very much非常感谢你

Brian Tran布赖恩·特兰

Remove the ^/.删除 ^/. Try尝试

<match url="files/(.*)$" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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