DDiVita
DDiVita

Reputation: 4265

IIS7 Rewrite Rule not working

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.

Upvotes: 0

Views: 1141

Answers (1)

Domenic
Domenic

Reputation: 112937

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

Upvotes: 2

Related Questions