public ActionResult Index(string alias, string alias2 = "") { if (string.IsNullOrEmpty(alias)) { throw new HttpException(404, "Page cannot be found"); } if (!string.IsNullOrEmpty(alias2)) { alias = String.Format("{0}/{1}", alias, alias2); } var entity = _redirectService.GetByAlias(alias); if (entity == null) { throw new HttpException(404, "Page cannot be found"); } return(Redirect(entity.Url)); }