views:

52

answers:

2

I've just installed and configured my server (WS2008, IIS7) with version 2 of the URL Rewriting Module. I've setup a simple static redirect as follows

/contact >>> /pages/contact/default.aspx

So users of the site have a simple url to get to the original, longer file path. It works great and even post backs to the right place.

My question is regarding the mapping of this page, now that the URL has changed, when I go back to my local development version. I develop using VS 2008 and it's built in web server, alongside another developer with the same setup, using SVN as source control. Now as far as I know there is no way to configure URL rewriting for these instances. So other than changing all of the path names used in the project before we publish and release it (not a realistic solution), I don't see how we can continue to work in this way. Is a different development configuration the answer or are there solutions to this?

Thanks

A: 

This is kind of a hackish solution. Add a httpmodule to your project that adds a filter to the Response stream. This filter would replace all instances of "/contact" with "/pages/contact/default.asp". Then only add the httpmodule into your development web.config file.

Mike J
+1  A: 

Maybe this is too obvious, but... what's stopping you from running IIS7 on your dev machines? I highly recommend IIS in the dev environment. Especially with IIS7 due to the new integrated pipeline. Doing anything else is like developing with "software X" when you're going to push "software Y" to your users.

If there's some reason you can't do that... Mike J's answer is quite reasonable: use a custom HttpModule.

Bryan
Good shout Bryan I could setup IIS7 on all of the dev machines but that's alot of work and alot to keep setup correctly. Imagine if I get someone in for the week to do some front end work (css + html) on a project. The time to setup IIS7 correctly compared with just VS and the inbuilt server is considerable in my eyes. Also I haven't come across any issues so far developing on the in built server against live web servers. I don't think you can say the difference is that black and white.
Sam Heller