Read this tutorial and learn several methods used to check if a string contains another substring in JavaScript or not. Read information and see examples.
Read and learn how to get the current URL in JavaScript by using Location object properties. Also, gain an understanding about URL and its components.
To redirect a URL page with Javascript you need to set the window.location object. Learn how to do it.