Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Handle500Erros : HttpRequestProcessor
- {
- public override void Process(HttpRequestArgs args)
- {
- if (args?.Context?.Response.StatusCode == (int)HttpStatusCode.InternalServerError)
- {
- var errorPageItem =
- Sitecore.Context.Database.GetItem(string.Concat(Sitecore.Context.Site.StartPath, Settings.ErrorPage));
- if (errorPageItem!= null && Sitecore.Context.Item.ID!= errorPageItem.ID)
- {
- Sitecore.Context.Item = errorPageItem;
- //var htmlForErrorPageForSpecificlanguage = GetHtmlforErrorItem
- // set response html to htmlForErrorPageForSpecificlanguage
- }
- }
- }
- }
- <customErrors mode="RemoteOnly" xdt:Transform="Replace">
- <error redirect="/error.html" statusCode="500" />
- </customErrors>
- <rule name="Server Error Rule" stopProcessing="true" enabled="true">
- <match url=".*" />
- <conditions>
- <add input="{URL}" pattern="^/error.html$" />
- <add input="{HTTP_HOST}" pattern="^(admin|www).(mysite1|mysite2|mysite3)?.*.(com|co.uk)" />
- </conditions>
- <action type="Rewrite" url="/errors/{C:2}.html" />
- </rule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement