Hello Everyone, I need some help. I have set up a redirect and rewrite rule such that www.mydomain.com/default.aspx gets redirected to www.mydomain.com/default and www.mydomain.com/default gets rewritten to www.mydomain.com/default.aspx. This, if I've understood it correctly should prevent users from seeing the url www.mydomain.com/default.aspx but still havethat pageserved when the friendlier url www.mydomain.com/default is displayed. Only it doesn't seem to work. I get 404 errors when I enter the URL www.mydomain.com/defaultand the redirect doesn't work at all. Possibly related (or not I don't know) when I build my application I get a warning: "The element 'system.webServer' has invalid child element 'rewrite'." Can anyone shed any light on either of these problems? Preferably the first one. Could I be missing something from my web.config, possibly here: <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <remove name="ScriptModule" /> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <!-- should I add a reference to the Rewrite assembly here --> </modules> Thanks alot, Mark
Hi Bruce, I don't know is the answer to that. I'm using the IIS7 management console and URL Rewrite appears in the list under IIS. Is there something else I should do? Mark
First, I recommend manually removing any references to the rewrite module in your web.config and reupload the fresh copy to your site. This is to make sure that any malformed configuration is removed from the config.Then, connect to your site using the IIS Manager. Click on the URL Rewrite module to add the rules. You'll want to add the rule called "User friendly URL".
Did anyone find a solution to this issue? I have the same error. "The element 'system.webServer' has invalid child element 'rewrite'."
If you are you getting this error locally on your computer, it means you don't have the module installed on your computer.
Not sure if this tidbit is related but I'll share it just in case. I had no problem installing all of the IIS7 tools and Manager on Vista Home Premium, which is what I used for the IIS7 Webcasts. But then on Vista Ultimate it was a real nightmare. Took me more than a month working with the IIS7 team to get things running on Ultimate. I still find the UAC controls easier to work with on the local IIS7 Manager under Vista Home Premium than the controls in Vista Ultimate. Just my own findings... Salute, Mark
Thanks for the replies everyone. I have the module installed on my Vista Home Premium. I even uninstalled and reinstalled it once. I still get this error. What are some of the things you tried with Ultimate? Pehaps they will work for me. Here is something interesting. After hours of trial, I found one of my rules worked despite this error, but only if I created a new web site and put it into the root (instead of application directory). However, all other simple rules still do not work... it is just this one random rule that seemed to work. So something is clearly broken with this module. There is nothing out of the ordinary about my setup. Vista SP1 and IIS7 and VS 2008 SP1. Unfortuately, about 50% of everything Microsoft makes is buggy for me. Anyone else have that experience? I wish there was a simple solution for this one though... it seemed like an amazing new feature.
This is the thread: http://forums.iis.net/t/1154060.aspx We never did nail it down but it seemed to be either Power Shell or the Brazilian Portuguese Language pack. (My lovely wife is Brazilian.) Salute, Mark