Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top