Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

redirection
url
meta
html

How to redirect to a web page using HTML

Educative Answers Team

In HTML, a meta tag allows you to redirect from one webpage to another. There are some specific attributes which are required by the tag to work accordingly.

Attributes

  • http-equiv: Used to simulate an HTTP response header. To redirect the user to a new page, this will be set to Refresh

  • content: Specifies the following:

    • time interval after which the page is to be refreshed
    • url of the new web-page

Syntax

The general syntax to redirect to another page using HTML is as follows:

<meta http-equiv = "Refresh" content = "0; url = https://www.newURL.com" />
svg viewer

Example

The following code redirects to a new web-page using the meta tag:

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Refresh" content="0; url=https://www.educative.io" />
  </head>
</html>

RELATED TAGS

redirection
url
meta
html
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring