Property in Bulgaria - Electronics - WoW Gold - Windsurfing Video - Debt Consolidation

PDA

View Full Version : help needed: Page Redirection


informationHell
Jul 7th 2008, 12:43 pm
hello,
i want to know that how to redirect ht*p://domain1.com/?AnyRandomNumber --> ht*p://domain2.com/?AnyRandomNumber


redirection time should be 5 seconds..


plz help.



if url is

abc.com/?123 ---> cde.com/?123
abc.com/?abc ---> cde.com/?abc
abc.com/?4s4 ---> cde.com/?4s4
abc.com/?ax1 ---> cde.com/?ax1

etc etc but with 5 second delay

bucabay
Jul 7th 2008, 2:47 pm
In javascript you can use:

window.location.href = 'http://domain2.com/?AnyRandomNumber';

to redirect the page...

to match the "AnyRandomNumber" part of the url, use the match() method or replace() method of the String.

eg:

var number = window.location.href.match(/[^\?]+$/);

anwaraa
Jul 11th 2008, 4:02 am
There you go:

<head>
<script type="text/javascript">

function run_it()
{
var fromUrl=window.location.href;
var params=new Array();
params=fromUrl.split("?");
var destUrl="http://www.someurl.com/" + params[1];
window.location.href = destUrl;
}

</script>
</head>
<body onload="setTimeout('run_it()', 5000)">