How to use Meta Tag to redirect an HTML page?
URL redirection, also called URL forwarding is a way to send users to a different URL from the one they originally requested. The three most commonly used redirects are 301, 302, and Meta Refresh.
Meta Refresh Redirect is a client-side redirect. Unlike 301 and 302 redirects that happen on the webserver, Meta Refresh Redirect takes place in a web browser and instructs the web browser to go to a different web page after a specified time span.
The use of Meta Refresh Redirect is deprecated or in other words, disapproved by W3C(World Wide Web Consortium), since it is a non-standard procedure of redirection, it disorients users, and it can also disrupt a browser’s history of visited pages.
Syntax:
<meta http-equiv = "refresh" content = "20; url = https://ide.geeksforgeeks.org"/>
Example:
<!DOCTYPE html> < html > < head > < title >Meta Refresh Redirection</ title > < meta http-equiv = "refresh" </ head > < body > < h1 style = "text-align:center;color:green;" > GeeksforGeeks </ h1 > < p style = "text-align:center;" > If your browser supports Refresh, you'll be redirected to GeeksforGeeks IDE, in 20 seconds. </ p > </ body > </ html > |
Output:
Before:
After:
Please Login to comment...