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
In javascript you can use: window.location.href = 'http://domain2.com/?AnyRandomNumber'; Code (markup): 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(/[^\?]+$/); Code (markup):
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)"> Code (markup):