Redirect someone from a referring domain to a webpage

P

Paul Lee

Hi all,
I'm trying to redirect users from a specific domain to one of my
webpages.
So, in my example, anyone accessing my index.html from the
*btinternet.com domain (allowing for wildcards!) will be redirected to
"update.htm".

I'm not bothered what the referring webpage was, I'm just interested
in
anyone accessing my page from a certain domain

This is what I have:

<HTML>

<HEAD>
<script type="text/javascript">
function redirect()
{
previousDomain = document.referrer

if(previousDomain.indexOf("btinternet.com") > -1)
{
window.location="update.htm"
}
}
</script>

</HEAD>

....snip.....

<BODY bgcolor="FFFFFF" TEXT="000000" LINK="00FF00"
onload="redirect()">

......snip......


but it doesn't want to work.... what have I done wrong?

Best wishes

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top