0

I am having an issue with the Url Rewrite module in IIS7. I have read several posts about this type of issue and I can't seem to figure it out.

Here is the rule:

<rule name="Imported Rule 11" stopProcessing="true">
   <match url="/s\/([\w\%20\s]+)\/default\.aspx" />
   <action type="Rewrite" url="\/landingpage.aspx\?mc={R:1}" 
     logRewrittenUrl="true" />
</rule> 

I imported it from a previous ISAPI ini filter that looks like the following:

RewriteRule ^\/s\/([\w\-\_\%20\s]+)\/default\.aspx \/landingpage.aspx\?mc=$1 [L,I]

I had to tweak the regular expression a bit to get it to work with the built in tester but it is matches against urls like

/s/RETQ211CA/default.aspx

And according to the log the request is coming through as:

2012-10-18 15:41:54 ::1 GET /s/RETQ211CA/default.aspx - 80 - ::1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+.NET4.0C;+.NET4.0E) 404 0 0 1468

This happens locally or through the internet.

Can someone tell me what exactly I'm doing wrong here?

Thanks!

1 Answer 1

1

The following rule will do the trick:

s\/([\w\%20\s]+)\/default\.aspx

You could start this rule with ^ and terminate with $ if you'd like.

The confusion is that url rewrite assumes you're in the root.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.