The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ErrorAreaRegistration.cs 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using Teknik.Configuration;
  4. namespace Teknik.Areas.Error
  5. {
  6. public class ErrorAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Error";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. Config config = Config.Load();
  18. context.MapSubdomainRoute(
  19. "Error.Http404", // Route name
  20. new List<string>() { "*", "error" }, // Subdomains
  21. new List<string>() { config.Host }, // domains
  22. "404", // URL with parameters
  23. new { controller = "Error", action = "Http404" }, // Parameter defaults
  24. new[] { typeof(Controllers.ErrorController).Namespace }
  25. );
  26. context.MapSubdomainRoute(
  27. "Error.Http403", // Route name
  28. new List<string>() { "*", "error" }, // Subdomains
  29. new List<string>() { config.Host }, // domains
  30. "403", // URL with parameters
  31. new { controller = "Error", action = "Http403" }, // Parameter defaults
  32. new[] { typeof(Controllers.ErrorController).Namespace }
  33. );
  34. context.MapSubdomainRoute(
  35. "Error.Http500", // Route name
  36. new List<string>() { "*", "error" }, // Subdomains
  37. new List<string>() { config.Host }, // domains
  38. "500", // URL with parameters
  39. new { controller = "Error", action = "Http500" }, // Parameter defaults
  40. new[] { typeof(Controllers.ErrorController).Namespace }
  41. );
  42. }
  43. }
  44. }