How can I set a redirect url for a virtual directory in IIS 7.0? I have installed the latest url rewrite module 2.x.
I can explain my problem with an example:
I have a website on my IIS 7.0 server, www.mysite.com. I decided to create a virtual directory "sales" under my site which is pointing to the website root directory. Now I need to create a redirect url for the vdir. The vdir is pointing to the same virtual root directory as my site root.
The big idea is that I can go to www.mysite/sales and I will automatically redirect to www.mysite.com?productid=200.
I tried to redirect with a rewrite url for vdir(not website), but I always get this error message:
Cannot add duplicate collection entry of type 'rule' with unique key
attribute 'name' set to "test".
This happens when I am pointing to the virtual vdir and try to add a rule.
I can add rules to the website level, but rules don't work. I mean url "www.mysite/sales" gives me the following error. I know that key is unique. I checked it from web.config.
This kind of feature was really easy use in IIS 6.0, just point at vdir with your mouse and set properties-->a redirect to url.
Please some one explain what is the right way to do it in IIS 7.0?