7.7 C
New York
Saturday, November 16, 2024

What They Are & Tips on how to Set One Up


What Is An HTML Redirect?

An HTML redirect, often known as a meta redirect or a meta refresh redirect, tells the customer’s internet browser to ship customers from one webpage to a different.

HTML redirects can both be immediate or delayed.

Instantaneous redirects occur instantly. Delayed redirects occur after a selected variety of seconds (set by the web site proprietor).

Right here’s the way it works:

  1. A consumer lands on a webpage with a meta redirect
  2. The redirect is triggered in one in every of two methods:
    1. If the redirect is immediate, the consumer is distributed to the brand new web page as quickly because the HTML of the present web page hundreds
    2. If the redirect is delayed, the consumer is distributed to the brand new web page after the HTML hundreds and the set period of time has handed 
  3. The redirect happens, and the consumer is now on the brand new web page and may proceed their journey
an image illustrating instant vs delayed HTML redirects

Why Use an HTML Redirect

HTML redirects may be handy to implement since they’re set inside the HTML of a webpage. You don’t want entry to server information—just like the .htaccess file—to implement one.

They are often helpful while you’re doing upkeep on a web page and must redirect customers to a short lived web page. Or while you now not wish to use a web page and must ship customers someplace else completely.

Different kinds of redirects—like server-side redirects—could require you to entry your server information. Which may be difficult (though plugins typically make this a lot simpler).

Though HTML redirects may be handy, there are a number of causes to keep away from them:

  1. They won’t work correctly on older browsers and result in a poor consumer expertise
  2. Because the HTML of the previous web page must load earlier than the redirect happens, they are often sluggish and irritating to customers
  3. They don’t move alongside as a lot hyperlink fairness (from the unique web page) as different kinds of redirects which may have an effect on your search engine marketing
  4. Delayed HTML redirects can current accessibility points for individuals with display readers or people who find themselves unable to learn textual content shortly
  5. Because you want the HTML of the primary web page, you’ll be able to’t completely delete any of the pages you wish to redirect and should preserve them up and working. This isn’t best if you wish to reorganize your web site’s construction.

Tips on how to Redirect a Web page to One other Web page in HTML

So as to add a redirection in your HTML, paste the beneath code into the <head> part of the web page you wish to redirect (and exchange the URL worth):

<meta http-equiv="refresh" content material="3; URL=https://www.yoururl.com/newpage" />

On this code:

  • http-equiv=“refresh” tells the browser to redirect the web page
  • content material=“3; tells the browser what number of seconds to attend earlier than refreshing the web page. On this instance, it’s three seconds. To make it an immediate redirect, set it to “0.”
  • URL=“URL=https://www.yoururl.com/newpage” tells the browser which URL to ship customers to

Simply be sure to’re cautious when selecting between an immediate and a delayed redirect. Google interprets immediate redirects as everlasting (which means you don’t plan to make use of the redirected web page once more) and delayed redirects as short-term.

HTML Redirect Greatest Practices and Examples

1. Keep away from Redirecting to Redirected Pages

Redirecting to a web page that already has a redirect is called a redirect chain.

Think about you land on a web site, and shortly after getting there, it redirects you to a brand new web page. After which that web page redirects you to a brand new web page …

Sounds irritating, proper?

an image illustrating a redirect chain

Not solely is that this annoying for customers, it’s additionally unhealthy to your search engine marketing.

You possibly can simply keep away from redirect chains—and preserve customers glad—by sending site visitors to pages that don’t have any redirects configured.

2. Redirect to a Related Web page

When attainable, ship customers to a related web page to lower the possibility of them leaving your web site altogether. 

Customers land in your web page as a result of they’ve a necessity.

Possibly they wish to study extra about your online business, contact you, or make a purchase order.

Attempt to decide that want and redirect customers to an analogous web page.

For instance, let’s say you promote footwear and have a product web page for purple sneakers. Sooner or later, you promote out of purple sneakers and must direct site visitors elsewhere quickly.

Which product web page makes extra sense: one other sneaker web page or a web page for high-heels? In all probability the sneaker web page.

By sending site visitors to a related web page, you’re assembly customers the place they’re to allow them to proceed their journey.

3. Inform Customers Why You’re Redirecting Them 

Whenever you set a redirect in HTML, your HTML must load earlier than the redirect happens.

Even if you happen to set an immediate redirect, in case your consumer’s web is sluggish, they might nonetheless see a portion of the preliminary web page earlier than they’re redirected.

As a substitute of exhibiting them a clean web page, add a blurb so that they know why you’re redirecting them.

Simply be certain the copy you embrace on the web page is brief and straightforward to learn. Goal for 20 phrases or fewer. This manner, customers can shortly learn in regards to the redirection earlier than it occurs.

Older browsers could not assist HTML redirects, which suggests if somebody lands in your web page, they gained’t get redirected to the brand new one.

Whether or not your redirect is delayed or immediate, embrace a hyperlink to the brand new web page so customers can click on onward if the redirect doesn’t work.

This manner, you don’t want to fret about dropping any site visitors and may guarantee guests find yourself on the proper spot.

an image illustrating "This page no longer exists" page with redirect

5. Guarantee Delayed Redirects Are Timed Correctly

Make sure that your redirects aren’t too lengthy or too brief. 5 seconds is often ample.

If a delayed redirect takes too lengthy, you danger customers bouncing—and people customers could by no means find yourself in your web site once more.

And if customers must learn a message, however the redirect is just too brief, they could really feel simply as pissed off.

Take a look at your delayed redirect to verify it’s not too lengthy—or brief.

Higher Options to HTML Redirects

301 and 302 redirects are sooner than HTML redirects, are much less more likely to harm your search engine marketing, and have much less influence on the consumer expertise in your web site. 

Right here’s when to make use of every one:

301 Redirects

301 redirects are everlasting redirects that inform engines like google you’ve moved content material to a brand new URL.

Use these while you:

  • Wish to direct customers from HTTP to HTTPS
  • Merge two pages collectively 
  • Delete a web page and exchange it with one thing else
an image illustrating a deleted page with 301 redirect to a new page

With a 301 redirect, you’re telling engines like google the previous web page now not exists. 

This manner, you move on a lot of the hyperlink fairness from the previous web page to the brand new web page. And engines like google know to replace the previous hyperlink with the brand new one within the search outcomes.

302 Redirects

302 redirects are short-term redirects. 

They’re helpful if it’s good to redirect customers for a sure time frame. Like when it’s good to carry out web page updates or wish to run an A/B take a look at. 

For instance, you’ll be able to implement a 302 redirect for a touchdown web page to check which call-to-action copy leads to extra conversions.

an image illustrating a 302 temporary redirect

Nevertheless, as a result of 302 redirects are solely short-term, engines like google could not replace the search outcomes with the brand new hyperlink.

This implies it’s good to preserve observe of your 302 redirects and take away them while you now not want them.

Tips on how to Audit Your Redirects

In case your web site has redirects, you’ll desire a fuss-free strategy to audit them and ensure they’re working as supposed.

You possibly can preserve a spreadsheet, however spreadsheets may be tedious to handle.

Plus, if you happen to neglect so as to add a redirect to your sheet, you would possibly neglect about it (and neglect to take away it if wanted).

A better method is to make use of Semrush’s Website Audit instrument.

To start out, go to “Website Audit” and arrange a brand new venture or click on on the prevailing venture you’d prefer to establish the redirects for.

Semrush’s Site Audit tool

Then, click on the quantity beside “Redirects.”

an arrow pointing to the number beside “Redirects” showing 339

Right here, you’ll see a listing of the redirects in your web site, the place you may make positive every web page has the suitable sort of redirect.

a list of the redirects on your site in Site Audit tool

This report additionally helps you see redirect chains.

Right here’s how.

Beneath “Points” seek for “redirect chain.”

search for “redirect chain”

Click on on “# redirect chains and loops.”

“102 redirect chains and loops” button highlighted

Use this report back to establish—after which repair—pages with a number of redirects to offer customers a greater expertise in your web site.

"Page URL with redirect link" section highlighted in the report

Utilizing Semrush’s Website Audit instrument, you may be assured that customers at all times find yourself the place they’re speculated to, with none trouble.

Related Articles

Latest Articles