HTML Redirect Code

Most of us think how index sites ends up with a non-index url, this is one of the reason why it happens. A redirection code is added in index file. This is just a simple HTML auto redirect code.

Here’s the code :

<meta http-equiv=”refresh” content=”N; URL=WEBURL”>

where :
N – the number of seconds that you want the currect page to be displayed before it redirects to the main page. If N is equal to 0, it will automatically refresh and go the the redirection page.
WEBURL – put the url of the page you want it to redirect

You must put this code in a file named “index.html” without quotes and add , the code will be like this.

 <head><meta http-equiv=”refresh” content=”N; URL=WEBURL”></head>

You can add a <p></p> tag to appear your message and it will look like this.

<head><meta http-equiv=”refresh” content=”N; URL=WEBURL”></head>
<p> Text here </p>

There is also another code :

<body onload=”window.location.replace(‘http://urlidhere&#8217;)”>

That’s all for this tutorial.

Published by Grey Uzuo

Simple cyber surfer sharing random things with credits.

One thought on “HTML Redirect Code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: