Quantcast
Channel: .Net Scraps - IIS 7
Viewing all articles
Browse latest Browse all 30

Did you know: Enable Custom Error (Language Specific Error Pages) in IIS 7 / 7.5 - Part 5

$
0
0

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.

  1. Click on the Web Site (Default Web Site in our case)
  2. In Features View, double click on Error Pages
  3. Click  Add…, under Status code: type 404
  4. 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”.
  5. Click Set…
  6. 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

    image1

    image2
  7. 404.htm is in C:\inetpub\wwwroot\custerr\fr-FR folder. You will need to create language specific folder as needed.

    image3
  8. 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




Viewing all articles
Browse latest Browse all 30

Trending Articles