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’)”>
That’s all for this tutorial.
Hi grey, i've implemented this code on my website and it works please let me know is there any code which we can put in .htaccess?
LikeLike