higgsy
higgsy

Reputation: 2011

IIS Rewrite Regular Expression rule

I am using IIS 7's URL Rewrite module. I have a rule where I am trying to say, if the url matches /news/<anything but the word "article">

<match url="news/([^/]+)"/>

How can I acheive this?

thanks higgsy

Upvotes: 1

Views: 1453

Answers (1)

MRAB
MRAB

Reputation: 20664

Try adding a negative lookahead:

news/(?!article)([^/]+)

The (?!...) part says "fail if ... matches" (but don't consume the characters).

Upvotes: 2

Related Questions