I installed windows 2008 server integrated iis 7.0
1 day ago, i use windows 2003 and iis 6.0
with windows 2008 server, everything is alright except one thing.
in 2003-iis6 i could use custom 404 pages to handle for url friendly sites. example i could set custom404.asp as custom 404 pages(execute url)
in 2008, i can't do it. when i set custom 404 page a开发者_如何学Cs /custom404.asp, nothing happens. in custom error pages it says this is for asp.net
how can i do it?
On the "Error Pages" section in IIS manager select the "Edit Feature Settings..." under the Actions section. Ensure that "Custom error pages" is selected.
the webconfig file below fixed the problem. i share in case anyone needs
save the code as web.config and move it to main site folder
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" subStatusCode="-1" prefixLanguageFilePath="" path="/default.asp" responseMode="ExecuteURL" />
</httpErrors>
<rewrite>
<rules>
<rule name="MyURLCleaned" enabled="false" stopProcessing="true">
<match url="^([^])+" />
<conditions>
<add input="{REQUEST_FILENAME}" />
</conditions>
<action type="Rewrite" url="/default.asp?{R:0}" />
</rule>
</rules>
<rewriteMaps>
<rewriteMap name="static">
</rewriteMap>
</rewriteMaps>
</rewrite>
</system.webServer>
</configuration>
精彩评论