views:

145

answers:

3

I need a regular expression for a rewrite rule on iis7, I'm trying to redirect http://www.website.com to http://www.website.com/sample. But I only want the empty url string (extra points if you can figure it out with and without '/'), and I'm unsure how to create a rewrite rule to match to that.

Can someone help me out here?

+1  A: 

not exactly sure what your looking for but this matches an empty url strip:

http//\Z

ennuikiller
+2  A: 
^/?$

I think...

Deniz Dogan
A: 

The question isn't very clear, but I think you want this:

^http://www.website.com/?$

The ^ and $ match the beginning and end of the string. The /? optionally matches a trailing slash.

Drew Noakes