|
-
Apr 12th, 2002, 07:36 PM
#1
Thread Starter
New Member
Domain Name Script to detect what domain name the visitor is using
Ok, I think this is the correct forum to post in.
Ok, I have one of those free domains at go.cc.
I get a lot of traffic from that domain to my main domain mydomain.com. Now go.cc hides the main domain and doesn't release it. So, no matter where you browse on my website, the browser URL stays at my go.cc domain.
I want my main domain page to be able to detect that the domain in the browser is not the main domain and break free from it and show the actual domain address. The reason being, is that I run Perl and CGI stuff and it is screwing up the logins.
Thanks...
-
Apr 13th, 2002, 04:03 AM
#2
Fanatic Member
Hi,
you can use this client-side Javascript check I wrote a while ago.
Code:
function findDomain(domainName){
if (document.location.href.indexOf(domainName)!=-1){
return true;
}else{
return false;
}
}
Put this in the <body onload> event...
Code:
if (findDomain("go.cc")==true){document.location.href="newdomain.com";}
... It basically checks to see if the domain name exists in the URL and returns true/false depending on whether it does. Then it redirects them to your real domain (newdomain.com in my example).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|