Redirect Page

 

Redirect Page

If you’re looking for a way to redirect your visitors to a new page, this JavaScript redirect page code is for you.

Many times, when designing your website, you may need to move a page to another location on your web server. However, you must find a way to redirect your visitors to the new page, as if you don’t, they will leave your website and may never return.

In addition, the Search Engines may have already indexed your page. If you don’t use a redirect code to send your Search Engine traffic to your new page, again, you may lose these visitors forever.

For these reasons, using a redirect code is of the utmost of importance. Not only will this redirect code enable you to provide your visitors with the information they’re looking for, but it will also prevent you from losing your visitors.

Note: When using this JavaScript redirect code, please ensure that you don’t use it to trick the Search Engines, as this could get your website banned.

Place the following JavaScript redirect code between the <head> and </head> tags of your HTML code.

This example is setup to redirect to another page in 2 seconds. When a page contains this JavaScript, it will be redirected to another page that you specify in the "window.location=". You can change the number of refresh seconds by changing the "move()’,2000 to the number of seconds you’d like.

Example:

1000 = 1 second
3000 = 3 seconds

 

Place this code between the <head> and </head> tags:

<script language="JavaScript">
<!–Script courtesy of http://www.web-source.net – Your Guide to Professional Website Design and Development
var time = null
function move() {
window.location = ‘http://www.yourdomain.com’
}
//–>
</script>

Place this code in your <body> tag:

<body onload="timer=setTimeout(‘move()’,2000)">

This concludes the Redirect Page code.

 
 

 
 
Visit the following pages for a wealth of copy and paste codes and tips:

HTML Tips
Copy and paste special effect HTML codes for your web page.

HTML Codes
An HTML codes chart you can use to copy and paste codes into your web page.

HTML Color Codes
An HTML color codes chart you can use to copy and paste color codes into your web page.

JavaScript Codes
Copy and paste special effect JavaScript codes for your web page.

Web Design Tips
Tips, tricks, and special effect codes for your web page.

HTML Tags
A list of HTML tags.

HTML 5 Tags
A list of the latest HTML tags to be developed.

ASCII Codes
Special text characters and code for your web page.