4

I have a website and I have installed URL Rewrite using Web Platform Installer. I wish to allow a user friendly URL like www.foo.com/123456 to go to www.foo.com/page.aspx?blah=123456. Using the User-friendly URL template accomplishes this except that the created rule also matches all of the /scriptresource.axd?blahblah created by ASP.NET which of course breaks most functionality. My initial attempts to exclude the script resource files have failed.

The regex generated by the tool is ^([^/]+)/?$

John Saunders
  • 160,644
  • 26
  • 247
  • 397
D.R. Payne
  • 101
  • 1
  • 4

3 Answers3

7

You can prevent this by adding the following to the section of your rule:

<add input="{URL}" negate="true" pattern="\.axd$" />
Nelson
  • 325
  • 2
  • 9
0

If all of the things you're interested in matching end with .com, .com\?\d{6,7}$ should match a period followed by com followed by a question mark followed by either 6 or 7 digits, provided they occur at the end of the string

0

I've had this problem as well. I found that is was my outbound url rewrite rule blocking the script resources. I managed to get round the problem by adding a precondition to my outbound rule that excluded files containing axd

Phil Hale
  • 3,453
  • 2
  • 36
  • 50