开发者

IIS7 Rewrite Rule not working

开发者 https://www.devze.com 2023-01-24 00:40 出处:网络
I have created a this rule: <rewrite> <rules> <rule name=\"ImageRedirect\" stopProcessing=\"false\">

I have created a this rule:

<rewrite>
        <rules>
            <rule name="ImageRedirect" stopProcessing="false">
                <match url="^(.*)/(.*)/" />
                <action type="Rewrite" url="http://www.lrgimages.com/ImageRewrite.aspx?=img={R开发者_开发知识库:2}" logRewrittenUrl="true" />
            </rule>
        </rules>
    </rewrite>

I keep getting a 404.0 message like the rule is not working or IIS is not picking it up. In the test parttern section for the rule, the pattern tests fine. If I go directly to the http://www.lrgimages.com/ImageRewrite.aspx that page loades, but not when I try: http://www.lrgimages.com/TestImage

any thoughts?

Update: I figured it out. It does not take into acount hte http://www.DomainName.com when rewriting a url. Redirects work this way since htat is what is is really doing. I am used to other rewrite engines not taking into account the http://www.DomainName.com . Thanks all you lead me in the right direction.


I don't think "/TestImage" matches ^(.*)/(.*)/ ...

0

精彩评论

暂无评论...
验证码 换一张
取 消