My current dilemma involves...
- I want to create a condition where if the URL specifically contains /foldername/index.htm or /foldername/ on mydomain.com, then it should redirect to http://www.example.com
- If the URL includes any URL parameter with /foldername/index.htm?example, there should be no redirection
- All other URLs should not trigger a redirect
Below is my incomplete JavaScript code which I am working on in order to address this issue...
var loc = ""+window.location;
if (loc.indexOf("mydomain.com") >= 0) {
var allowedUrls = ["/foldername/index.htm", "/foldername/"];
window.location = "http://www.example.com";
}
The goal of this script is to manage traffic coming to a specific URL that some users have bookmarked. We want to track the number of visits before deciding on further actions regarding the page.