Can some one please help me to understand how to do this following PHP's simple redirection in either Javascript or jQuery?
If the client wanted to redirect the www.clientsite.com/bbc
to http://www.bbc.com/
then in PHP I would just make the "bbc" folder and create an index.php
file in it and add these lines:
<?php
header("Location: http://www.bbc.com/");
?>
So my question is, how can I redirect www.clientsite.com/bbc
to BBC
page, or if it's www.clientsite.com/food
then to Food Network
and so on with either Javascript or jQuery? Thank you very much in advance!
UPDATE:
Thank you everyone for your help! For some reason the window.location.href
wasn't redirecting my page, so I ended up using the window.location.replace
. And found these pages very helpful: