public ActionResult RedirectProductTag(string id, bool idIncludesSename = true) { var tagId = idIncludesSename ? Convert.ToInt32(id.Split(new char[] { '-' })[0]) : Convert.ToInt32(id); var tag = _productTagService.GetProductById(tagId); if (tag == null) { return(RedirectToActionPermanent("Index", "Home")); } return(RedirectToRoutePermanent("ProductsByTag", new { productTagId = tag.Id })); }