Guide

How URL Redirects Work: Status Codes, DNS and HTTPS

Michel BardelmeijerMichel Bardelmeijer

Michel Bardelmeijer is Tech Lead and Sales at redirect.pizza, where he helps DevOps and IT teams solve domain redirect challenges at scale. Michel has guided organizations like SD Worx, Zurich Airport and Harvard through complex redirect scenarios involving thousands of domains.

Have questions about bulk redirects, HTTPS migrations, or domain consolidations? Connect with Michel on LinkedIn or reach out to the redirect.pizza team.

A URL redirect sends a visitor from one address to another. Someone types oldbrand.com and lands on newbrand.com, usually without noticing. Behind that one step sit several: a DNS lookup, a TLS handshake for HTTPS, a response with a status code, and a second request to the new address.

Most redirect problems start in one of those steps. A missing certificate stops the visit before the redirect can run. A temporary status code on a permanent move sends search engines the wrong signal. A chain of hops adds a round trip to every visit.

This page follows a redirect from the first lookup to the final page. It also covers the status codes that matter, where a redirect can run, and what changes with HTTPS. Each section links to a deeper article when you need the details.

Key Takeaways

  • A redirect is an HTTP response with a 3xx status code and a Location header. The browser follows it with a second request to the new address.
  • 301 and 308 are permanent, 302 and 307 are temporary. 307 and 308 keep the request method, 301 and 302 may turn a POST into a GET.
  • Over HTTPS, the browser checks the certificate before any redirect can arrive. Without a valid certificate for the hostname, the visitor gets a warning instead of the new address.
  • Google uses a permanent redirect as a signal that the target should be canonical. After a site move, keep redirects in place for at least a year.
  • A redirect can run in a web server, a CMS, at the registrar or at the DNS level. A DNS-level service forwards whole domains, certificates included, without a server of your own.

Header for How URL Redirects Work: Status Codes, DNS and HTTPS

What a URL redirect is

A URL redirect is an HTTP response that tells the client to fetch a different address. The server answers with a status code in the 3xx range, such as 301 or 302, and a Location header that holds the new URL. Browsers follow that header automatically, and so do search engine crawlers.

Not every 3xx code moves anything. A 304 Not Modified tells the browser to use the copy it already has. The codes you use for redirects are 301, 302, 303, 307 and 308.

Redirects exist because addresses change. A rebrand moves a site to a new domain, and a migration changes the URL structure. A campaign needs a short address on a domain you own, and example.com and www.example.com should end up on one version.

How a redirect works, step by step

Take a visitor who opens https://oldbrand.com/page after the site moved to newbrand.com. This is what happens, in this order.

    1. 1

      DNS lookup. The browser asks DNS for the IP address of oldbrand.com. With a DNS-level redirect, that address belongs to the redirect service, not to the old website.

    2. 2

      TLS handshake. Because the address starts with https://, the browser opens an encrypted connection first. The server presents a certificate, and the browser checks that it is valid for oldbrand.com.

    3. 3

      The request. Over that connection, the browser asks for /page.

    4. 4

      The redirect response. The server answers with a status code such as 301 and a Location header that points to https://newbrand.com/page.

    5. 5

      The second request. The browser starts again for the new address, with its own DNS lookup, TLS handshake and request, and shows that page.

    6. 6

      Caching. A browser can store the redirect. 301 and 308 responses are cacheable by default, so a returning visitor may skip the old address altogether.

    Crawlers walk the same path. Googlebot follows up to 10 redirect hops when it crawls general web content, but each hop is another round trip for every visitor. One hop from the old URL to the final URL is the target. Redirect Chains and Loops shows how to find and flatten longer chains.

    One redirect in five steps: DNS lookup, TLS handshake, request for /page, 301 + Location, second request to newbrand.com

    Redirect status codes at a glance

    Five status codes cover nearly every redirect. The difference comes down to two questions: is the move permanent, and may the browser change the request method?

    CodeNamePermanent or temporaryRequest method
    301Moved PermanentlyPermanentMay change from POST to GET
    308Permanent RedirectPermanentStays the same
    302FoundTemporaryMay change from POST to GET
    307Temporary RedirectTemporaryStays the same
    303See OtherPoints to another resourceThe next request is a GET or HEAD

    For search engines, permanent versus temporary is what counts. Google uses a permanent redirect as a signal that the target should be canonical. A temporary redirect isn't used as that signal, although the target can still be indexed when other signals point to it. Use a 301 when the move won't be reverted, and a 302 when the old URL will come back.

    The full list, including the rarely used codes, is in HTTP Redirect Status Codes. For the most common choice, read 301 vs 302 Redirect: Which Should You Use?

    Where a redirect can run

    The same redirect can live in five places. Which one fits depends on whether the old address still has a website behind it.

    • Web server. Rules in Apache, Nginx or IIS, or in your application code. Full control over paths and conditions, but the old address needs a running server and a certificate.
    • CMS. Redirect managers and plugins handle page moves inside one site, such as a renamed post in WordPress.
    • Registrar or DNS provider. Many offer forwarding for a whole domain. Whether that works over HTTPS, and for paths deeper than the homepage, differs per provider, so test it before you rely on it.
    • DNS-level redirect service. You point the domain's DNS records to the service, which answers the requests, holds the certificates and returns the redirects. The old domain needs no server of its own.
    • Browser. A meta refresh tag or JavaScript on the old page. Google reads an instant meta refresh as permanent and a delayed one as temporary, and recommends server-side redirects wherever possible.

    Page moves inside a live site usually belong in the CMS or the web server. Domains that only exist to forward, after a rebrand, a merger or a campaign, are where a DNS-level service saves you a server. DNS-Level vs Server-Side Redirects compares the two in detail, Domain Forwarding Explained covers the registrar option, and Best Domain Redirect Tools compares the services.

    A DNS-level service versus a web server or CMS: what each is for, where it runs and what the old address needs

    Why HTTPS changes the order of events

    With an https:// address, the redirect waits behind a check the visitor never sees. The TLS handshake comes first, and the browser validates the certificate for the hostname before it sends any HTTP request. The redirect is part of the HTTP response, so it can only arrive after that check passes.

    If the old hostname has no valid certificate, the browser shows a warning such as "Your connection is not private" instead of the new address. On a domain that used HSTS, the browser doesn't even offer a way past the warning.

    Without a valid certificate the browser shows a warning. With one, the check passes and a 301 leads to newbrand.com

    That makes the certificate part of the redirect. Every hostname that should redirect over HTTPS needs one: the apex and www, each subdomain, and every old domain you still forward. Why HTTPS Redirects Break goes through the failure modes one by one.

    Certificates also run out faster than they used to. Under a CA/Browser Forum schedule, the maximum lifetime of public TLS certificates drops from 398 days to 47 days, in steps from March 2026 to March 2029. Shorter SSL Lifetimes: Why Redirects Break First covers what that means for redirects.

    A DNS-level service such as redirect.pizza requests a certificate for each source hostname through the ACME protocol, from Let's Encrypt and ZeroSSL, and renews it before it expires. Automatic HTTPS explains how.

    A redirect on an old domain is only as reliable as the certificate behind it. At 47 days, renewal is no longer something you remember once a year. If no system owns it, the domain stops forwarding over HTTPS the day the certificate expires.

    Michel Bardelmeijer, Tech Lead at redirect.pizza

    Redirects and SEO

    Search engines treat a redirect as a statement about which URL counts. A permanent redirect tells Google the new URL should be the one in the index, so it can take the old URL's place. A temporary redirect leaves that question open.

    Three habits keep a move clean. Map each old URL to the page that replaces it, rather than sending everything to the homepage. Redirect in one hop. And keep the redirects in place: for site moves, Google advises keeping them "for as long as possible, generally at least 1 year".

    Are Redirects Bad for SEO? covers the myths, Do 404 Errors Hurt SEO? covers what happens without a redirect, and the Domain Migration SEO Checklist follows a full move day by day.

    Setting up a redirect with redirect.pizza

    With a DNS-level service, a redirect takes three steps. How to Set Up a Domain Redirect shows each one in detail.

    1. 1

      Add the redirect. In the dashboard, enter the source hostnames, the destination, 301 or 302, and whether the path and query string carry over.

    2. 2

      Point DNS. Set the DNS records of the source domain to redirect.pizza. The dashboard shows which records to set for the apex and for subdomains.

    3. 3

      Let the certificate follow. Once the records point to redirect.pizza, the certificate is issued automatically and the redirect answers over HTTP and HTTPS. Depending on the TTL of the old records, that takes from a few minutes to a day.

    Run the old address through the redirect checker to see every hop and status code. For more than a handful of domains, How to Bulk Import Domain Redirects covers CSV imports, starting with a small test batch.

    Add the redirect, point DNS, wait a few minutes to a day, then the certificate is issued automatically

    Checklist: before, during and after a move

    Before the move

    • List every hostname that should redirect, including www, subdomains and old campaign domains.
    • Map each old URL to its new URL.
    • If DNS moves too, lower the TTL of the old records a day ahead.

    During the move

    • Redirect the apex and www, over HTTP and HTTPS.
    • Use a 301 for moves that won't be reverted, a 302 for anything temporary.
    • Carry over paths and query strings wherever the old URLs had them.

    The http and https versions of oldbrand.com and www.oldbrand.com each redirect with a 301 to https://newbrand.com

    After the move

    • Test the old addresses, including a deep path and a URL with a query string.
    • Check that every old hostname serves a valid certificate.
    • Watch the traffic on the old domains, and keep the redirects for at least a year.

    Redirect Analytics: What to Monitor covers what to watch afterwards, and Retiring a Domain Without Breaking It covers the day you want to stop.


    Frequently Asked Questions

    Yes, but not for everyone at once. You can remove or change the redirect at any time. Browsers that already followed it may have stored it, because 301 responses are cacheable by default. They keep going to the old target until that entry expires or the cache is cleared. Search engines update when they recrawl the old URL. If a move might be reverted, use a 302 until you are sure.

    The redirect works the moment the server returns it. The wait is in getting requests to that server. After a DNS change, resolvers keep the old records until their TTL runs out, which can take from a few minutes to a day. With a DNS-level service, the certificate follows once DNS points to the service. Search engines process the redirect when they recrawl the old URL, which can take longer.

    Domain redirects delivered hassle-free

    Get started right away

    • Free plan
    • No creditcard required

    Serving millions of redirects for

    Warner Bros.
    Harvard
    CalTech
    Jaguar
    Palo Alto Networks
    Cloudera
    Raymond James
    ElevenLabs
    Visit California
    FACEIT
    Red Bull
    Boels Rental
    Bam
    Nando's
    Culture Gouv FR
    Visma
    team.blue
    SD Worx
    Unit4
    Kneipp
    Zurich Airport
    SRF
    Kaefer
    DC Thomson
    Hirslanden
    C.H. Beck
    IU
    Framery
    Mehiläinen
    Intersport
    JAKO
    Steiff
    Switzerland Tourism
    Concept2
    Teamleader
    Ascension
    Chargify
    JBS SA
    NESN
    Wunderman Thompson
    Lerner Publishing Group
    RGF Staffing
    Apollo
    MCC
    Dansk Erhverv