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

by vivek 12/31/2009 10:48:00 PM

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



blog comments powered by Disqus

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

All Items
Sign in

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2012, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0