Redirect Website using Meta Tag
0
up 0 down 1
Thank you for voting !

Redirect Website using Meta Tag

A page redirect means forwarding the URL to another location. For example, we request "http://www.infoconic.com/web-1" to browser and browser redirect to "http://www.infoconic.com/web-2" instead. Redirection is done on server side and client side as well. When no client side redirection method exist, browser send request to server and server checks if any server side redirection is available.

Redirect examples include forward a page to new path , change the URL structure of a site , remove "www." from the URL, or even redirect visitors to HTTPS.
In this article I’ll teach you how to redirect just by using a meta tag in head section. This Meta tag will never redirect emails for your domains.

However, there may be some cases where meta refresh tags are always necessary.
1) when we don’t have permission to edit .htaccess file.
2) In case of HTML templates, Apply redirection to only one template. So we can paste meta tag in head section of that template.

Let’s assume we need to migrate domain and we have new new domain name and need to shut down the old domain. we can’t stop users to visit the old domain but we can redirect the old domain to new domain.

Indeed , the simplest way to redirect to another URL is redirect Meta tag. We can place this meta tag inside the <head> section of any HTML page:

<meta http-equiv="refresh" content="100;URL='http://www.example.com'" />


Definition and Usage

AttributeDescription
URLURL is the web address to which the current page will get redirect.
contentSpecifies the property’s value. Here content attribute indicate time in seconds to wait for redirect
http-equivUsed for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie.


Complete Example Code:

</DOCTYPE html>
<html lang="en">  
  <head>
    <title>Webnius Infotech</title>      
    <meta http-equiv="refresh" content="100;URL='www.infoconic.com/web-2'" />    
  </head>
  <body>
    <p>This page has moved to <a href="http://www.infoconic.com/web-2"> www.infoconic.com/web-2</a></p> 
  </body>
</html>

Something To Say ?

Your email address will not be published. Required fields are marked *

*