/    Sign up×
Community /Pin to ProfileBookmark

Mirror redirection

When visitors click [url]www.mywebsite.com[/url] I would like to have:
visitor 1 redirected to [url]www.mywebsite.com/abc[/url]
visitor 2 redirected to [url]www.mywebsite.com/def[/url]
visitor 3 redirected to [url]www.mywebsite.com/ghi[/url]
etc.

and have the ablilty to change the redirections manually.

I believe this is called a rotator.

Will someone please help?

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@s1deusOct 07.2005 — I know this can be doen in JavaScript. You might want to post this Q there or even search the JS archives for it.

Just trying to help.
Copy linkTweet thisAlerts:
@tabzterOct 07.2005 — <script type="text/javascript">

var mySites=new Array();

mySites[0]="www.mywebsite.com/abc";

mySites[1]="www.mywebsite.com/def";

mySites[2]="www.mywebsite.com/ghi";

[I]//follow the same format as above and add as many more as you want.[/I]

var sites=mySites.length;

var randomNum=Math.floor(Math.random()*sites);

window.location.href=mySites[randomNum];

</script>[/QUOTE]


Add the above code in between the <head></head> section of the index page in your www.mywebsite.com webPage.
Copy linkTweet thisAlerts:
@felgallOct 07.2005 — That doesn't do what was requested. It redirects visitors randomly instead of to the next page on the list. A server side rotator script would be needed to redirect as specified.
Copy linkTweet thisAlerts:
@tabzterOct 09.2005 — Good Point Felgall. Maybe I should analyse the question a bit more closely instead of rushing through it.

P.S. Is it really you giving advice on programming in javascript.about.com?
×

Success!

Help @EddyOdom spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...