IIS重写file.png到index.php?file=file.png。

问题描述 投票:0回答:1

我不知道如何重定向:"https:/images.url.comctest.png。"到。"https:/images.url.comcindex.php?file=test.png。"

<rule name="filerewrite" stopProcessing="true">
<match url="^c(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="false" />
</conditions>
<action type="Rewrite" url="c/index.php?file={R:1}" />
</rule>

还是说

404或重定向到index.php?file=cindex.php?file=c...等等。

iis web-config
1个回答
0
投票

你的模式有问题。

如果你使用你的模式,那么{R: 1}是 "test.png"

你可以尝试改变你的模式,如下。

^c/(.*)$

问候

萨姆

© www.soinside.com 2019 - 2024. All rights reserved.