title: Redirect to url in ASP MVC
body: <p>I have an action result method that inside is doing a Redirect(url). My question is how can I check that the url is valid before I do the redirect ?</p>
  
  <pre><code>public ActionResult RedirectUser()
  {
      var url = "/Cars/Model/1"; //this is the url
  
      // now i should check if the redirect return a 200 code (the url is valid) and if is valid I should redirect to that url, else i should redirect to "/Home/Index"
  
      if(this.Redirect(url))
      {
         return this.Redirect(url);
      }
      else
      {
         return this.RedirectToAction("Index", "Home");
      }
  
      return this.RedirectToAction("Index", "Home");
  }
  </code></pre>
  
  <p>Can anyone help me with an example ? I search on google but I couldn't find anything to help me. Thanks</p>