How to Redirect a Website Using the Meta Refresh Tag
On this page
One simple way to redirect visitors from an old webpage or domain to a new address is to use the Meta Refresh tag.
This method instructs the visitor’s browser to automatically load a different URL after a specified amount of time.
How Meta Refresh Works
The redirect is performed using the following HTML tag:
<meta http-equiv="Refresh" content="0; url=https://new-domain.com" />
The value:
0
specifies the delay in seconds before the redirect occurs.
A value of 0 means the redirect happens immediately.
Example HTML File
Create a file named:
index.html
and add the following content:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Refresh" content="0; url=https://new-domain.com" />
</head>
<body>
Redirecting...
</body>
</html>
Replace:
https://new-domain.com
with the destination URL where visitors should be redirected.
Uploading the File
Place the index.html file in the website’s root directory.
By default, this is:
public_html
Example:
yourdomain.com/public_html/index.html
When a visitor accesses the website, the browser will automatically redirect them to the specified address.
Delayed Redirects
You can display a message before redirecting users by increasing the delay value.
Example:
<meta http-equiv="Refresh" content="5; url=https://new-domain.com" />
This redirects the visitor after 5 seconds.
You may also customize the page content:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Refresh" content="5; url=https://new-domain.com" />
</head>
<body>
<p>You are being redirected to our new website...</p>
</body>
</html>
Meta Refresh vs. HTTP Redirects
While Meta Refresh redirects are simple to implement, they are generally not recommended for permanent website migrations.
For permanent redirects, it is better to use:
.htaccessredirects (Apache)- Nginx redirect rules
- Control panel redirect tools
These methods use HTTP status codes such as:
301 Moved Permanently
which are preferred by search engines and browsers.
Meta Refresh redirects are most useful when:
- You cannot modify server configuration.
- You only need to redirect a single page.
- You need a temporary client-side redirect.
Summary
To redirect visitors using the Meta Refresh tag:
- Create an
index.htmlfile. - Add a Meta Refresh tag pointing to the destination URL.
- Upload the file to the website’s root directory (
public_html).
Example:
<meta http-equiv="Refresh" content="0; url=https://new-domain.com" />
This will automatically redirect visitors from the current page to the specified address when the page is loaded.
Didn't find an answer?
Our support team is here for you 24/7 – write to us and we will help you sort it out.