Bill Greer
Bill Greer

Reputation: 13

RegEx help for IIS URL Rewrite

I need to take request for

www.domain.com/123456/Catalog.aspx

and rewrite to

www.domain.com/Products/Catalog.aspx?ItemID=123456

where 123456 will always be numbers.

Any help is appreciated. Thanks.

Upvotes: 1

Views: 1390

Answers (1)

Rohan Singh
Rohan Singh

Reputation: 21475

You want to match this pattern:

^(\d+)/([^/]+)$

And then rewrite to this URL:

Products/{R:2}?ItemId={R:1}

Upvotes: 2

Related Questions