Ok, I made a thread before but i think its all tapped out..
Anyways, we are running a website with 2 different URLs, but the same exact content/IP and files. I started working on this js that will redirect users depending on which URL they enter through. Basically a company changed thier name, and wants users to go to a page (that i already created) that lets the user know the have changed thier name and website, then redirect them to the new URL.
But if they just go right to the correct/new URL, it just takes them to the index.asp file. And obviously i cant just make the page i created for the redirection and name it index.asp because it will change on both sites…
Here is the code i have so far, it is checking which URL they entered (the old one begins with [url]www.unified[url]www.urbi
[code]
function whichDomain()
{ var webAddress = location.hostname;
if (webAddress.substring(0,4) == “www.”)
{
if(webAddress.substring(5,6)==”n”)
{
return “n”;
}
if(webAddress.substring(5,6)==”r”)
{
return “r”;
}
} // end if www
else
{
if(webAddress.substring(1,2)==”n”)
{
return “n”;
}
if(webAddress.substring(1,2)==”r”)
{
return “r”;
}
}
}
function itemChooser(pageItem){
var returnString;
if(whichDomain()==”n”)
{
if (pageItem == “?”)
{
returnString = “?”;
}
}else{
if (pageItem == “?”)
{
returnString = “?”;
}
}
return returnString;
}