views:

33

answers:

1

I am trying to make a rewrite rule to check whether the URL ends with .htm or .html, but does not contain Archive.aspx.

The url starts out like

www.contoso.com/test.htm  (or .html)

and ends up like

www.contoso.com/Archive.aspx?page=/test.htm

How can I do this with a regular expression?

+1  A: 

You can use negative lookahead: (?!Archive\.aspx).*\.html?$

SLaks