Printer Friendly Version
Email this thread to a friend
|
Unusual script request (In: Coding & Databases - PHP, ASP, Perl, etc.)
how to get music url? (In: General Search Engine Optimization)
Featured Web Site Template |
|
Reflects user activity within the last 5 minutes
|
|
| Member |
Message |
scottyrob
Joined: Jan 01, 2005
# Posts: 2
|
Posted: 2005-Jan-01 17:06
If anyone can help me with the code I need to redirect a domain name I would greatly appreciate it.
I'm just getting started advertising and I've purchased a domain name that I want to use in my marketing. I would rather use my own short domain name instead of the long affilliate URL (that's the best way to do it from what I gather).
I need the script that I can use on my server that will redirect them to my affilliate link when they click on my domain.
Any help would be greatly appreciated.
Thanks,
Scott
|
 |
g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418
|
Posted: 2005-Jan-01 18:06
If you use an Apache webserver then you do this with a few lines of code in the .htaccess file, found in the web root. Google for a tutorial on this; and don't forget to use a 301 redirect (rather than a 302 redirect or a meta redirect).
|
 |
birchj
Joined: Jan 03, 2005
# Posts: 16
|
Posted: 2005-Jan-03 13:27
I used to have hired webhosting on a remote machine. I had no access to config files, but had many domains on the mahine. So I wrote the following script.
If you are using webpage forwarding to your donmain use the FromPage variable. If you are using domain name lookup use the Location variable.
Basically each forward is two lines of code:
Check what is requesting:
else if (Location == "http://www.arcadegames.co.uk/" )
Forward to appropreate area:
location.href = "/cgi-bin/aspvote/arcadegames.asp";
Full script, you will have to put your domain name(s) forwarding location(s) into it and remove mine:
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT>
function Main()
{
var FromPage;
var Location;
FromPage = document.referrer;
FromPage = FromPage.toLowerCase();
Location = location.href;
Location = Location.toLowerCase();
if (FromPage.charAt(FromPage.length - 1) != '/')
FromPage += "/";
if (Location == "http://www.jadab.co.uk/" Location == "http://www.jadab.com/" )
location.href = "/cgi-bin/aspvote/jadab.asp";
else if (Location == "http://www.jason-birch.co.uk/" Location == "http://www.jason-birch.com/" )
location.href = "/cgi-bin/aspvote/jason-birch.asp";
else if (Location == "http://www.urababe.co.uk/" Location == "http://www.urababe.com/" )
location.href = "/cgi-bin/aspvote/urababe.asp";
else if (Location == "http://www.arcadegames.co.uk/" )
location.href = "/cgi-bin/aspvote/arcadegames.asp";
else if (Location == "http://www.arcadepinball.co.uk/" )
location.href = "/cgi-bin/aspvote/arcadepinball.asp";
else if (Location == "http://www.classiccomputer.co.uk/" )
location.href = "/cgi-bin/aspvote/classiccomputer.asp";
else if (Location == "http://www.projectutopia.co.uk/" )
location.href = "/cgi-bin/aspvote/projectutopia.asp";
else
location.href = "/cgi-bin/aspvote/palmisland.asp";
}
</SCRIPT>
</HEAD>
<BODY OnLoad="Main()">
</BODY>
</HTML>
|
 |
g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418
|
Posted: 2005-Jan-03 17:06
Search engines may not properly follow a javascript redirect.
Be prepared for some very odd results for your sites in the SERPs.
|
 |
birchj
Joined: Jan 03, 2005
# Posts: 16
|
Posted: 2005-Jan-03 18:46
Place links on the page so search engines find the real roots of your website.
|
 |
scottyrob
Joined: Jan 01, 2005
# Posts: 2
|
Posted: 2005-Jan-03 21:24
I appreciate everyone's feedback. And I thought it was going to be easy. Thanks Birchj, I'll try that code.
Scott.
|
 |
g1smd
Staff
Joined: Jul 28, 2002
# Posts: 10418
|
Posted: 2005-Jan-05 00:02
The 301 redirect is a LOT eqasier to do.... and more effective.
|
 |
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
- You have not yet logged in, or registered properly as a member
- You are a member, but no longer have posting rights.
- This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you cannot find this message, click here to Re-Send it.
|
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.
|
Switch to Advanced Editor and ...
Create a New Topic
or Reply to this Thread
|
|