Simple Redirect
Javascript Code
+ 0 likes
Please Register to submit score.
| Average Score | 0.0 (of 0 scores) |
| Date Added | Jul 01, 2008 |
| Last Updated | Jul 01, 2008 |
Introduction
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:
| Quote: |
| <script type="text/javascript"> var p=location.href; var s="http://www.google.com/"; if (p==s) { window.location = "http://www.hawkee.com/"; } </script> |
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 <head></head>
Javascript Snippet:
Simple Redirect
Posted on Jul 19, 2008 4:55 pm
Posted on Jul 19, 2008 4:55 pm
Jeez, these are SIMPLE snippets.
Javascript Snippet:
Simple Redirect
Posted on Aug 19, 2008 2:40 pm
Posted on Aug 19, 2008 2:40 pm
Yes, this was the first Javascript I attempted, I've now gone on to slightly more advanced stuff.
Javascript Snippet:
Simple Redirect
Posted on Apr 26, 2009 4:36 pm
Posted on Apr 26, 2009 4:36 pm
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?
Javascript Snippet:
Simple Redirect
Posted on May 5, 2009 10:17 am
Posted on May 5, 2009 10:17 am
Following your link, I get a "Page not Found"








