I thought I missed a small but can be a very useful feature in Error Pages in IIS 7 / 7.5. You can now configure language specific error pages in IIS. So say I want to show 404 – Not Found error in French for users with French server language.
- Click on the Web Site (Default Web Site in our case)
- In Features View, double click on Error Pages
- Click Add…, under Status code: type 404
- Click "Insert content from static file into the error response", and select the check box “Try to return the error file in the client langauge”.
- Click Set…
- Under Root directory path: type custerr, remember custerr is in C:\Inetpub\wwwroot folder. If your error pages reside in a different location specify the complete path
- 404.htm is in C:\inetpub\wwwroot\custerr\fr-FR folder. You will need to create language specific folder as needed.
- Click OK
My web.config file:
<httpErrors errorMode="Custom"><error statusCode="404" prefixLanguageFilePath="custerr" path="404.htm" responseMode="File" /></httpErrors>
OR
<httpErrors><error statusCode="404" prefixLanguageFilePath="E:\custerr" path="404.htm" responseMode="File" /></httpErrors>
Hope this helps,
Vivek Kumbhar
Quote of the day:
Sometimes I've believed as many as six impossible things before breakfast. - Lewis Carroll