Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net, url rewrite module and web.config

i'm using ASP.net with .NET 3.5 on IIS7 (Vista) with the URL Rewrite Module from Microsoft.

This means, that i have a

<system.webServer>     <rewrite>...</rewrite>     ... </system.webServer> 

section within the web.config, but i get a warning, that within the system.webServer the element "rewrite" is not allowed.

How can i configure my system to allow (and maybe even have Intellisense) on the rewrite-part of the web.config?

Thank you Christoph

like image 227
Christoph Avatar asked Dec 12 '08 16:12

Christoph


People also ask

What is URL Rewrite module?

About the URL Rewrite module The Microsoft URL Rewrite Module 2.0 for IIS 7 and above enables IIS administrators to create powerful customized rules to map request URLs to friendly URLs that are easier for users to remember and easier for search engines to find.

What is URL Rewrite in asp net?

The concept of URL rewriting is simple. When a client sends a request to the Web server for a particular URL, the URL rewriting module analyzes the requested URL and changes it to a different URL on the same server.


2 Answers

I was able to get this working in Visual Studio 2010.

Start with Ruslan's post here and download the 2.0 IntelliSense file. Then, just follow the directions he posted previously here. All I ended up doing was running the following command as Ruslan instructs:

C:\download_directory\rewrite2_intellisense>cscript UpdateSchemaCache.js

As Christoph points out in his comment, make sure you replace VS90COMNTOOLS with VS100COMNTOOLS in UpdateSchemaCache.js before running the above command if you are using Visual Studio 2010.

I did not need to restart Visual Studio. I added the <rewrite> section only to the applicable Web.config transformation files, as having it in the main Web.config breaks local debugging.

like image 132
Jonathan Freeland Avatar answered Sep 28 '22 04:09

Jonathan Freeland


I believe you need to have the URL Rewrite Module "installed" within the web.config file on your system.

You either need to install the module on your application via the IIS 7.0 interface or have your hosting firm do it for you.

like image 40
Randy Burgess Avatar answered Sep 28 '22 04:09

Randy Burgess