Simple Redirect

By vaseline28 on Jul 01, 2008

Simple redirect, if you go to URL "REDIRECT FROM", you will be redirected to "REDIRECT TO".

For example, if I move domain name, I could put in the homepage of my old domain (e.g. www.google.com) this to redirect to my new one, hawkee:

When a user goes to www.google.com, they are redirected to www.hawkee.com
Very simple I know, I just needed it recently, and it's reasonably useful.

Usage Instructions:
Replace:
REDIRECT FROM (to the URL to be redirected from)
REDIRECT TO (to the URL to be redirected to)
and then place in

<script type="text/javascript">
var p=location.href;
var s="REDIRECT FROM";
if (p==s) {
window.location = "REDIRECT TO";
}
</script>

Comments

Sign in to comment.
vaseline28   -  May 05, 2009

Following your link, I get a "Page not Found"

 Respond  
PATX   -  Apr 26, 2009

mine does not wok.... i have it on http://patx44.webs.com/svn/ but when i got to it it does not redirect to http://patx44.webs.com as it should anyhelp?

 Respond  
vaseline28   -  Aug 19, 2008

Yes, this was the first Javascript I attempted, I've now gone on to slightly more advanced stuff.

 Respond  
markusPHP   -  Jul 19, 2008

Jeez, these are SIMPLE snippets.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.