Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Modify one par of a URL and redirect

javascript URL parse



2:40 am on Nov 7, 2006 (gmt 0)

5+ Year Member

Hi guys,

I'm a rooking to Javascript and am stuck on this problem. People come to my site as
[mysite.com?submittosearch=yes?state=CA?city=Sacramento?...] ...

And so forth. But we have shut down mysite. I dont want to redirect without the query string: is it possible to direct that person to:

[mysite2.com?submittosearch=yes?state=CA?city=Sacramento?...] ...

I.E., keep the search string but change the domain? I cannot do this on the server side; I.E., it has to be done with javascript or something on the client side. Can anyone help?

Thank you!


8:41 pm on Nov 7, 2006 (gmt 0)

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 5+ Year Member

related thread: [webmasterworld.com...]

Then once you have the url query you just have to change the location:

document.location.href = "new_link";

Good luck!


Featured Threads

Hot Threads This Week

Hot Threads This Month