Translate This Blog
Remember To Always Back Up Your Template Before Attempting Any Of The Tweaks On This Site

Redirect Script

With this script you can redirect visitors to a different location. You need to be careful how you use this script because it can cause your blog to be locked by the spam detection bot.

I do not recommend redirecting people to a different blog or domain other then the one you are using the script on. It is not allowed to redirect people to a different domain without their consent. Do not put this script on your homepage either. The spam detection bot works in strange ways and if this script is on your homepage it may view it as a spam blog. The reason is many spam sites use tactics similar to that to get more traffic. As a example someone could make 10 blogs and add this script to them redirecting them to one blog which redirect them to another and creates a big loop. This would allow them to get multiple impressions on their ads. Well at least until Google figures it out then their ad account will be deleted and blogs locked for spam.

Really this script should only be used with a action such as after someone sends you a email or something through a contact option which will redirect them to a thank you screen or back to the homepage.  Another use for this is for site maintenance so you can temporarily direct users to a post that says we are under maintenance or something to that effect.

However you choose to use it is up to you but I am not responsible for any problems it may cause.

Their are 2 different scripts you can use. The first one is a little safer since it does not cause a loop issue when you hit the back button.
<script type="text/JavaScript">
location.replace('http://www.example.com/');
</script>
This next one has a time delay on it which will redirect in a set amount of time. This however can cause problems if you have ads because if a users is to hit the back button it would keep redirecting them which goes against most ad policy's.  But since you are using it with a set amount of time it will not be so much of a loop and give the user time to navigate without being  redirected instantly.
<script type="text/JavaScript">
setTimeout("location.href = 'http://www.example.com/';",5*1000);
</script>   
The red number is the number of seconds till the script is activated.  Its a little bit of math involved because the 1000 is milliseconds and their are 1000 milliseconds in a single second. All I am doing is 5x1000 which equals 5000 milliseconds or 5 seconds. 

Make sure to replace the URL (blue) with one of your own for both of these codes.

0 comments:

Post a Comment

Please don't post hyperlinked text within the comment box! It will not be published and you will be marked as spam.

Web Design Blogs PageRank