Click to See Complete Forum and Search --> : Help with a redirect please!


docmcneil
08-25-2003, 10:11 AM
I'm trying to use the "window.location.href" variable to refer a browser to another page.

I have 3 specific subdomains for my site...

hotashell.platinum-pro.com
priesttattoo.platinum-pro.com and
www.platinum-pro.com

I made the platinum-pro.com/index.html nothing more than a redirect page.

I tried a simple script like this:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (window.location.href = "http://priesttattoo.platinum-pro.com/") window.location.replace("tattoo/priesttattoo.html");
if (window.location.href = "http://hotashell.platinum-pro.com/") window.location.replace("hotashell.html");
if (window.location.href = "http://www.platinum-pro.com/") window.location.replace("index1.html");
// End -->
</script>

but I'm quite sure I didn't do it right.

Can someone show me what I need to do to make this work?

Thank you
Kevin

AdamBrill
08-25-2003, 11:00 AM
Try changing it to this:<script type="text/javascript">
<!-- Begin
if (window.location.href == "http://priesttattoo.platinum-pro.com/") window.location.replace("tattoo/priesttattoo.html");
if (window.location.href == "http://hotashell.platinum-pro.com/") window.location.replace("hotashell.html");
if (window.location.href == "http://www.platinum-pro.com/") window.location.replace("index1.html");
// End -->
</script>If that's not what you wanted, then try to explain what you wanted different...

docmcneil
08-25-2003, 11:32 AM
Actually, that is one of the cominations that I tried... and it didn't work either.

But thanks anyway... I found another way to make it work...

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (location.href.indexOf("hotashell") != -1){
window.location.replace("hotashell.html");
}
else{
if (location.href.indexOf("priesttattoo") != -1){
window.location.replace("tattoo/priesttattoo.html");
}
else {
window.location.replace("index1.html");
}
}
// End -->
</script>


that one took care of it.