1. Semrush
  2. Blog
  3. SEO
  4. Technical SEO

How to Set Up an HTML Redirect (+ Alternatives)

Author:Tushar Pol

6 min read

February 12, 2025

Contributors: Christine Skopec and Simon Fogg

Setting up an HTML redirect to another page is easy.

In fact, you can do it in just a few minutes (even if you're not a technical expert).

In this guide, we’ll walk you through exactly how to set up redirects using HTML step by step. Plus, we'll share some alternative redirect methods that are even better.

Before we dive in, let's cover the basics.

What Is an HTML Redirect?

An HTML redirect is a way to automatically send visitors from one URL to another using a simple HTML tag (called meta refresh), which you can add to the <head> section of your HTML.

Here’s a quick example of what that tag might look like:

<meta http-equiv="refresh" content="0; URL=https://example.com/new-page" />

In this example, the browser will refresh the existing page immediately and redirect the user to the new URL (https://example.com/new-page).

You might use an HTML redirect (also called a meta redirect) when:

HTML redirects can be handy if you don’t have access to your server settings. However, they're not as good as server-side redirects, which offer better performance (faster load times) and more control over the redirect process, including the ability to handle different types of HTTP status codes.

That said, if you need a quick fix to reroute visitors without modifying server configurations, an HTML redirect can be just what you need.

How to Redirect a Page to Another Page in HTML

Simply paste the below code into the <head> section of the page you want to redirect and replace the “content” and the “URL” values.

<meta http-equiv="refresh" content="0; URL=https://example.com/new-page"/>

Here’s an overview of the main components:

Just make sure you’re careful when choosing between an instant and a delayed redirect.

Google interprets instant redirects as permanent (meaning you don’t plan to use the redirected page again) and delayed redirects as temporary.

HTML Redirect Best Practices

When implementing an HTML redirect to a new page, follow these best practices:

Why to Avoid HTML Redirects When Possible

Although HTML redirects can be convenient, there are a few reasons to avoid them if you can:

Better Alternatives to HTML Redirects

Instead of implementing redirects with HTML, consider using more reliable alternatives like server-side 301 and 302 redirects.

301 and 302 redirects are faster than HTML redirects, are less likely to hurt your SEO performance, and have less impact on the user experience.

Here's what each redirect means and when to use them:

301 Redirects

301 redirects are permanent redirects that tell search engines a page has moved forever.

Use these redirects when:

A deleted page is 301 redirected to the new page.

With a 301 redirect, you’re telling search engines the old page no longer exists.

With this method, you pass on much of the link equity from the old page to the new page. And search engines know to update the old link with the new one in the search results.

302 Redirects

302 redirects are temporary redirects that tell search engines a page has moved for the short term.

Use 302 redirects when:

Because 302 redirects are only temporary, search engines may not update search results with the new link.

This means you need to keep track of your 302 redirects and remove them when you no longer need them.

Easily Audit Your Redirects

If your site has redirects, you’ll want a fuss-free way to audit them and make sure they’re working as intended.

You can use a spreadsheet for tracking, but spreadsheets can be tedious to manage.

Plus, if you forget to add a redirect to your sheet, you might forget about it (and forget to remove it if needed).

An easier way is to use Semrush’s Site Audit tool.

To start, enter your domain name and click “Start Audit.”

An example domain is entered into the tool.

The tool will prompt you to set up a project and configure your audit settings. After that, the tool will automatically start auditing your website.

Once the audit is complete, you’ll see an overview report like this.

Then, click the number beside “Redirects.”

Under Crawled Pages, redirects are listed with a blue, hyperlinked number.

Here, you’ll see a list of the redirects on your site, so you can make sure each page has the right type of redirect.

A list of page URLs has a 301 redirect status code.

Site Audit also helps you spot redirect chains.

Here’s how:

Under the "Issues" tab, search for "redirect chain" and click on the number of redirect chains and loops found.

For this example, 10 redirect chains and loops were discovered during the site audit.

Use this report to identify—and then fix—pages with multiple redirects to give users a better experience on your site.

The report lists page URL with redirect link, the initial redirect URL, the final destination URL, and more.

When you use Site Audit, you can be confident that users always end up where they’re supposed to.

Manage Your Redirects

with the Site Audit Tool

Sign Up Now

Share

Author Photo

Tushar Pol

Tushar has been involved in SEO for the past six years, specializing in content strategy and technical SEO. He gained his experience in agencies, where he worked on various ecommerce and B2B clients. On the Semrush blog, he writes about SEO and marketing based on experience drawn from his client work, focusing on sharing practical and effective strategies. His goal is to turn Semrush blog into the ultimate destination for learning SEO and web marketing.

Author Photo

Tushar Pol

Tushar is an SEO expert with over six years of experience in content strategy and technical SEO. Having worked with various ecommerce and B2B clients at agencies, he now writes for the Semrush blog, sharing practical and effective SEO strategies.

Try Semrush
Everything you need to win AI visibility and drive SEO success
Start Free Trial
Unlimited access for 7 days

More on this

Boost your digital marketing efforts
Get free trial