title: How to redirect URL in Javascript or jQuery
body: <p>Can some one please help me to understand how to do this following PHP's simple redirection in either Javascript or jQuery?</p>
  
  <p>If the client wanted to redirect the <code>www.clientsite.com/bbc</code> to <code>http://www.bbc.com/</code> then in PHP I would just make the "bbc" folder and create an <code>index.php</code> file in it and add these lines:</p>
  
  <pre><code>&lt;?php
    header("Location: http://www.bbc.com/");
  ?&gt;
  </code></pre>
  
  <p>So my question is, how can I redirect <code>www.clientsite.com/bbc</code> to <code>BBC</code> page, or if it's <code>www.clientsite.com/food</code> then to <code>Food Network</code> and so on with either Javascript or jQuery? Thank you very much in advance! </p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>Thank you everyone for your help! For some reason the <code>window.location.href</code> wasn't redirecting my page, so I ended up using the <code>window.location.replace</code>. And found these pages very helpful:</p>
  
  <ul>
  <li><a href="http://www.yourhowto.net/how-to-redirect-url-in-javascript-or-jquery" rel="nofollow">http://www.yourhowto.net/how-to-redirect-url-in-javascript-or-jquery</a></li>
  <li><a href="http://www.rapidtables.com/web/dev/javascript-redirect.htm" rel="nofollow">http://www.rapidtables.com/web/dev/javascript-redirect.htm</a></li>
  </ul>