A redirect is simply a mode to nonstop radical and bots to a caller URL erstwhile they petition the aged URL, but the leafage has changed locations. When you determination to a caller code successful the US, you acceptable up message forwarding with the United States Postal Service (USPS). If idiosyncratic sends message to your aged address, USPS volition look astatine their message forwarding rules and recognize you nary longer unrecorded astatine the aged location. They’ll instrumentality the message and present it to your caller determination alternatively of the old one. That’s besides however redirects work. A idiosyncratic oregon bot requests the aged location, and they get forwarded to the caller location. For example, we moved blog.ahrefs.com to ahrefs.com/blog a portion back. If you effort to entree blog.ahrefs.com, you volition beryllium forwarded to the caller URL instead. Watch what happens. You’ll privation to usage redirects to: Redirects assistance harvester signals betwixt pages and assistance hunt engines find which leafage they should amusement to users. This is simply a process called canonicalization and Google uses it to assistance support duplicate pages retired of its index. In different words, redirects are important for SEO. There are a batch of myths and misunderstandings surrounding redirects successful the SEO assemblage that I anticipation I tin wide up with this article. Redirects tin either beryllium imperishable oregon temporary, depending connected whether you program to permission the redirect successful spot oregon not. This besides impacts which leafage volition beryllium indexed and shown successful hunt engines which I’ll screen much successful the adjacent section. Redirects tin besides beryllium server-side, meaning they hap connected a server somewhere, oregon client-side, meaning they hap wrong the user’s browser. Here are a fewer tables you tin notation that categorize the antithetic types of redirects. I’ll speech much astir each of these successful the adjacent section. As acold arsenic which method you should take to instrumentality imperishable redirects, my preferred bid would be: 308 / 301 > Meta refresh 0 / HTTP refresh 0 > JavaScript > Crypto As acold arsenic which method you should take to instrumentality impermanent redirects, my preferred bid would be: 307 / 302 / 303 > Meta refresh 0 / HTTP refresh 0 Server-side redirects don’t needfully person to hap connected your hosting server. It could beryllium “someone else’s server” similar a CDN oregon your domain sanction provider. Client-side redirects tin besides beryllium added successful aggregate ways, but they volition ever occurrence successful the user’s browser. Here are immoderate of the places you mightiness find these redirects: Let’s look astatine these successful much detail. A imperishable redirect indicates that a assets has permanently moved to a caller location. You should usage a imperishable redirect when you: Permanent redirects are a beardown hint for canonicalization that signals from a page, similar links, should consolidate guardant to the leafage the caller URL. It is usually the caller leafage that volition person each the signals and beryllium shown successful hunt engines. Say you redirect a leafage from site1.com/x to site2.com/x without changing the content. Link signals volition consolidate astatine site2.com/x. In different words, if site1.com/x has 10 backlinks, site2.com/x feels the payment of them arsenic if they constituent straight to it. It’s lone if a redirect is irrelevant that this doesn’t hap due to the fact that Google treats irrelevant redirects arsenic brushed 404s. For example, accidental you redirect a blog station to your homepage. Google whitethorn not consolidate nexus signals due to the fact that the 2 pages are wholly different. Sidenote. Google may, successful precise uncommon cases, inactive dainty the archetypal URL arsenic the canonical mentation that gets shown successful the index. Lots of SEOs cognize that the other tin happen, that impermanent redirects tin beryllium treated arsenic imperishable redirects, but imperishable redirects tin occasionally beryllium treated arsenic impermanent redirects as well. Want to cheque however google is treating a redirect? Here’s how: If you get nary matches for respective referring domains, Google is apt treating the redirect arsenic a brushed 404 and not counting the aged page’s backlinks toward the new URL. If determination is simply a match, click connected the tract to spot the existent links. If you spot the aged URL successful the “Target URL” column, Google is consolidating links astatine the new URL. Let’s look astatine immoderate of the types of imperishable redirects. A 301 redirect is simply a server-side redirect that forwards bots and users to the caller URL and tells hunt engines that the assets has permanently moved. A 308 redirect is the aforesaid arsenic a 301 redirect, but it retains the HTTP method of the archetypal request, GET oregon POST, erstwhile performing the redirect. For SEO purposes, they’re the same, but if you person information being sent done forms, you don’t privation to beryllium switching betwixt GET and POST. A JavaScript redirect uses JavaScript to instruct the browser to redirect the idiosyncratic oregon bot to a antithetic URL. Because a leafage needs to beryllium rendered for this benignant of redirect to fire, it’s client-side and not preferred. Google renders each leafage they’re going to index, but determination tin beryllium issues successful this process causing rendering to fail. Other redirect types are amended supported and much reliable. Here’s an illustration of however the redirect mightiness look successful the HTML: JavaScript redirects could perchance beryllium successful the config record arsenic well. In the Next.js config, there’s a redirect relation you tin usage to acceptable redirects. In different systems, you whitethorn find them successful the router. A meta refresh redirect tells the browser to redirect the idiosyncratic aft a acceptable fig of seconds. It happens successful the browser and is client-side. Meta refresh redirects request to beryllium successful the <head> conception of the HTML. This is however they look: An HTTP refresh is similar a meta refresh but it occurs successful the HTTP header response. It tin beryllium implemented server side, but it really fires connected the lawsuit side. Here’s however it looks: A redirect without really redirecting? It sounds strange, but Google treats this arsenic a imperishable redirect. That means they should besides walk each signals guardant to the new URL. A crypto redirect is simply a peculiar lawsuit wherever you person a connection astir moving to a caller domain, but nary existent redirect occurs. It looks like this: I would effort to instrumentality a antithetic redirect method arsenic not each bot oregon hunt motor would enactment crypto redirects. A impermanent redirect indicates that a assets has temporarily moved to a caller location. You should usage impermanent redirects when you: Temporary redirects are a anemic hint for canonicalization that signals from a page, similar links, should consolidate guardant to the caller page. Because it is simply a anemic signal, astir of the clip the signals really consolidate to the archetypal leafage that was redirected. However, astatine immoderate point, capable signals whitethorn physique that a impermanent redirect does consolidate forward. For a while, you whitethorn spot the archetypal URL indexed successful Google and signals consolidate there, but if this swap happens past you volition spot the caller URL successful Google and signals volition consolidate determination instead. There’s nary acceptable magnitude of clip that a impermanent redirect needs to beryllium earlier Google starts treating it arsenic a imperishable redirect. Usually, it’s a fewer weeks to a fewer months, but it tin beryllium days, weeks, oregon months. The swap whitethorn ne'er happen, similar successful the lawsuit of 302s being utilized to redirect users to the astir applicable mentation of their homepage connected planetary websites. This setup has been utilized by galore sites for astir a decennary and they inactive person the archetypal URLs indexed. In immoderate circumstances, Google adjacent appears to dainty impermanent redirects arsenic imperishable redirects from the get-go. For example, I ran an experimentation wherever I redirected (302) 1 established tract to another. When Google saw the redirect, it dropped the aged domain from the hunt results successful favour of the “new” domain. If you’re not definite however Google is treating 1 of your impermanent redirects, paste the redirected URL into Search Console’s URL Inspection tool. If it shows the “URL is not connected Google” warning, Google indispensable beryllium treating the redirect arsenic permanent. If it is connected Google, past Google’s treating it arsenic temporary. Just marque definite to cheque the past crawl day erstwhile doing this. If this day comes aft you added the redirect, petition reindexing and travel back later. Sidenote. Google seems quicker to dainty impermanent redirects arsenic imperishable redirects erstwhile redirecting to an established leafage oregon site. That’s apt due to the fact that the caller leafage oregon website has been astir a while, truthful there’s a bully accidental you meant to redirect the URL permanently. Let’s look astatine immoderate of the types of impermanent redirects. A 302 redirect forwards users to the caller URL and tells hunt engines that the assets has temporarily moved. A 307 redirect is the aforesaid arsenic a 302 redirect, but it retains the HTTP method (POST, GET) of the archetypal petition erstwhile performing the redirect. For SEO, it’s the same, but if you person information being sent done forms that redirect, past you don’t privation to beryllium swapping betwixt GET and POST. It’s worthy calling retired that erstwhile troubleshooting redirect issues, you whitethorn spot a antithetic mentation of a 307 which is simply a cached redirect that happens successful the browser. This is related to HSTS and tells the browser to swap to a unafraid transportation (HTTPS) erstwhile an insecure assets is requested. When web servers necessitate clients to lone usage HTTPS connections (HSTS policy), Google won’t spot the 307 due to the fact that it’s cached successful the browser. The archetypal deed (without cache) volition person a server effect codification that’s apt a 301 oregon a 302. But your browser volition amusement you a 307 for consequent requests which makes it much hard to troubleshoot. You volition request to usage a caller Incognito league to spot the returned presumption code. A 303 redirect forwards the idiosyncratic to a assets akin to the 1 requested and is simply a impermanent signifier of redirect. It’s typically utilized for things similar preventing signifier resubmissions erstwhile a idiosyncratic hits the “back” fastener successful their browser. You won’t typically spot 303 redirects utilized for SEO purposes, but if you bash past it volition beryllium treated conscionable similar a 302/307. A meta refresh is treated arsenic a imperishable redirect erstwhile it is adjacent to 0 seconds and arsenic a impermanent redirect erstwhile it is greater than 0 seconds. A meta refresh redirect tells the browser to redirect the idiosyncratic aft a acceptable fig of seconds. It happens successful the browser and is client-side. Meta refresh redirects request to beryllium successful the <head> conception of the HTML. This is however they look: An HTTP refresh is treated arsenic a imperishable redirect erstwhile it is adjacent to 0 seconds and arsenic a impermanent redirect erstwhile it is greater than 0 seconds. An HTTP refresh is similar a meta refresh but it occurs successful the HTTP header response. It tin beryllium implemented server side, but it really fires connected the client-side. Here’s however it looks: A server-side redirect is 1 wherever the server decides wherever to redirect the idiosyncratic oregon hunt motor erstwhile a leafage is requested. They volition usually person a corresponding presumption codification of 301, 302, 303, 307, or 308. Server-side redirects are the preferred method of doing redirects for SEO. These are redirects that hap connected your server. How you instrumentality them volition alteration depending connected your website big and which server situation oregon publication connection is utilized for the backend. Any communal benignant of server should beryllium good documented. The astir communal are Nginx, Apache, Cloudflare Server, LiteSpeed, Microsoft-IIS, and Node.js. If you are entering redirects successful a plugin oregon a customized redirect solution connected a CMS similar WordPress, Shopify, Wix, Squarespace, Joomla, oregon Drupal, past the redirects are being added astatine the server level. Most WordPress installs volition beryllium moving Apache and the plugins utilized for redirecting volition really beryllium editing a website’s .htaccess file. You’ll find this record successful your website’s basal directory. Sidenote. If you don’t spot this record successful your site’s basal directory, either your server isn’t moving connected Apache, you don’t person this file, oregon it’s hidden. You tin cheque the benignant of server you’re moving with this tool. If it’s Apache, the solution is to make a .htaccess record and upload it to your basal server. If you’re moving Nginx, work this. If you’re moving Windows/IIS, work this. To make a redirect successful .htaccess from 1 leafage to different you would add: You tin besides redirect with antithetic languages specified arsenic PHP. Here’s what that would look like: We person a batch much examples successful our station connected 301 redirects including redirecting a domain, www to non-www, non-www to www, and HTTP to HTTPS, Redirects could besides beryllium located successful the server config file. In galore communal systems, you tin conscionable enactment successful a redirect and it volition occurrence automatically. However, immoderate systems enactment arsenic mistake catchers. You tin enactment successful a redirect and it won’t occurrence until you delete the aged page. This adds an other measurement to the process, but is little prone to errors. Your sanction servers are usually managed by your domain registrar oregon perchance your CDN. Each supplier differs a bit, but they usually person documentation that you can find. Redirects astatine this level are often utilized for website migrations. Some hosts whitethorn fto you specify the presumption codification for a redirect specified arsenic a 301 or 302. Some providers are adjacent allowing HTTPS versions of pages to beryllium redirected. Technically, HTTPS doesn’t beryllium astatine this level and this wasn’t an enactment successful the past, but immoderate providers person figured retired a mode to marque this work. Many CDNs person aggregate options for implementing redirects. For example, connected Cloudflare you could bash azygous oregon bulk redirects, determination are circumstantial redirect rules, you could constitute a leafage regularisation with a redirect, you tin usage workers and key-value pairs to instrumentality redirects, oregon you could usage workers to modify the headers and adhd a redirect. I typically similar to person redirects connected the borderline (CDN-level) implicit having them connected the server. For others, I ever urge going with what is easiest for you to implement. For galore radical that is server-level redirects. A client-side redirect is fired by the user’s browser. A idiosyncratic whitethorn spot a leafage temporarily earlier the redirect happens. You mostly shouldn’t bash redirects connected the client-side, unless that is your lone option. We’ve already talked astir meta refresh redirects and JavaScript redirects. These are fired connected the lawsuit side. Meta refresh redirects request to beryllium successful the <head> conception of the HTML. This is however they look: Here’s however a JavaScript redirect mightiness look successful the HTML: An HTTP refresh is similar a meta refresh but it occurs successful the HTTP header response. It tin beryllium implemented server side, but it really fires connected the client-side. Here’s however it looks: I talked earlier astir Cloudflare workers. These fto you edit things connected the borderline earlier being served to users. You could really re-write immoderate of the HTML to adhd successful a client-side redirect similar a meta refresh, but this would beryllium uncommon due to the fact that determination are amended ways to do it. Here are a fewer items related to redirects that you’ll privation to check. Everyone should beryllium utilizing HTTPS. There are a mates of ways to cheque that your tract is decently redirecting from HTTP to HTTPS. The archetypal is to instal and activate Ahrefs’ SEO Toolbar, past effort to navigate to the HTTP mentation of your homepage. It should redirect. You typically privation to spot a 301 oregon 308 redirect here, arsenic this redirect should beryllium permanent. However, you whitethorn spot a 307 redirect if your tract uses HSTS similar we bash for Ahrefs. This benignant of 307 fires successful the browser and you inactive request to cheque the server effect to marque definite it’s a 301 or 308. So here’s different method: You should spot the “Not crawlable” mistake for some the www and non-www versions of your homepage, on with the “301 moved permanently” notification. Implementing HSTS (HTTP Strict Transport Security) connected your server stops radical from accessing non-secure (HTTP) contented connected your site. It does this by telling browsers that your server lone accepts unafraid connections and that the browser should 307 redirect to the HTTPS mentation of immoderate HTTP assets they’re asked to access. Keep successful caput that this happens wrong the browser. Bots won’t spot this peculiar mentation of a 307. After implementing HSTS, see submitting your tract to the HSTS preload list. This enables HSTS for everyone trying to sojourn your website—even if they haven’t visited it before. Sites, and the web successful general, are ever changing. We ran a survey that recovered that ~two-thirds of links to pages connected the web disappeared successful the nine-year play we looked at. In galore cases, your aged URLs person links from different websites. If they’re not redirected to the existent pages, past those links are mislaid and nary longer number for your pages. It’s not excessively precocious to bash these redirects, and you tin rapidly reclaim immoderate mislaid worth and assistance your contented fertile better. Here’s however to find those opportunities: I usually benignant this by “Referring domains.” I adjacent created a script to assistance you lucifer redirects. Don’t beryllium frightened away; you conscionable person to download a mates of files and upload them. The Colab notebook walks you done it and takes attraction of the dense lifting for you. Redirect chains are erstwhile aggregate redirects instrumentality spot betwixt a requested assets and its last destination. Google’s official documentation says that Googlebot follows up to 10 redirect hops, truthful immoderate redirect chains shorter than that aren’t usually a occupation for SEO. They travel 5 hops successful 1 session, and volition resume wherever they near disconnected successful the adjacent session. If the crawler doesn’t person contented wrong 10 hops, Search Console volition amusement a redirect mistake successful the site’s Index Coverage report. Many SEOs are obsessed with getting escaped of adjacent 1 further hop for a redirect. I would not interest astir this at all. I don’t typically interest astir redirect chains if they are little than 5 hops, but aft 5 I’ve seen issues with them being crawled and counted decently truthful that’s my cutoff for recommending that radical commencement moving on them. You tin find agelong redirect chains for escaped utilizing Ahrefs Webmaster Tools: Click the contented and deed “View affected URLs” to spot URLs that statesman a redirect concatenation and each the URLs successful the chain. Redirect loops are infinite loops of redirects that hap erstwhile a URL redirects to itself oregon erstwhile a URL successful a redirect concatenation redirects backmost to a URL earlier successful the chain. They’re problematic for 3 reasons: The simplest mode to find redirect loops is to crawl your tract with a instrumentality similar Ahrefs’ Site Audit. You tin bash this for escaped with an Ahrefs Webmaster Tools account. If you past click the mistake and click “View affected URLs,” you’ll spot a database of URLs that redirect, arsenic good arsenic each URLs successful the chain: The champion mode to hole a redirect loop depends connected whether the past URL successful the concatenation (before the loop) is the intended last destination. If it is, region the redirect from the last URL. Then marque definite the assets is accessible and returns a 200 presumption code. If it isn’t, alteration the looping redirect to the intended last destination. In some cases, it’s bully signifier to swap retired immoderate internal links to remaining redirects for nonstop links to the final URL. When creating redirect rules, sometimes radical lucifer to everything aft a folder. This creates situations wherever a clump of pages mightiness beryllium redirected to a azygous page. You privation to lucifer redirects 1:1 arsenic overmuch arsenic possible. You tin trial this by typing your domain.com/asfkljlkdfs oregon thing similar. You whitethorn privation to effort immoderate of your main folders arsenic well. If you person a 404 page, past it’s fine. If it redirects, past idiosyncratic has an overly wide regularisation in place. These rules aren’t needfully harmful, but they tin nonstop users to unexpected places. In immoderate cases, it could beryllium harmful. Let’s accidental you had a clump of pages added via a hack and the hacker built links to these pages. If you region the pages and past redirect them somewhere, you’re fundamentally saying those spam links beryllium to you. If you migrated to a antithetic domain and your aged tract was utilizing HTTPS, past the certificate expires, bots are passed but users volition person an mistake connection and won’t beryllium redirected. There are multi-domain certificates that screen aggregate sites that tin assistance forestall this issue. Some DNS providers besides let HTTPS redirects present which would forestall this from happening. According to Google, you should support redirects progressive for astatine slightest 1 year. After that, signals should permanently pass. If you don’t judge it, I tested it, and it seems to be true. I’m a instrumentality of keeping redirects arsenic agelong arsenic possible, perchance forever. You besides should cheque if users are inactive hitting the aged pages earlier removing immoderate redirects. It’s a bully thought to redirect things similar images and PDFs erstwhile doing a migration, not conscionable pages. Especially if these were driving a bully magnitude of postulation for your website. Don’t interest astir things similar JS, CSS, oregon Font files. Focus connected redirecting things that get indexed by hunt engines and don’t interest astir different file types. Here are immoderate tips to assistance you troubleshoot redirect issues. Things tin get analyzable successful an endeavor environment. You whitethorn person aggregate antithetic systems wherever redirects tin beryllium inputted and you whitethorn request to fig retired which is really firing a redirect. You tin usage the accusation successful the HTTP headers to assistance place what strategy whitethorn person fired a redirect. For example, connected our blog we usage a plugin called Redirection. It adds a header tag X-redirected-by that identifies that it is the 1 that fired the redirect arsenic seen beneath successful the URL overview of Site Audit. Our SEO Toolbar is different enactment for a speedy header cheque portion you’re browsing. Redirects tin usage conditional logic, meaning that they volition lone hap nether definite conditions similar for a specified user-agent. You tin alteration your idiosyncratic cause utilizing our SEO Toolbar to spot if a redirect fires for a circumstantial user-agent. Don’t blindly spot the presumption codes shown. A redirect tin inactive beryllium happening with immoderate presumption code. You whitethorn person a leafage that shows arsenic a 200 OK presumption code, but inactive really beryllium redirecting to different location. Regular expressions volition prevention you a batch of clip erstwhile it comes to patterns that tin beryllium matched for bulk URL redirects. Google a usher oregon cheat expanse and find a bully regex tester. I typically usage regex101.Permanent Redirects Server-Side Client-Side No Actual Redirect HTTP 301 Meta refresh (=0 seconds) Crypto redirect HTTP 308 HTTP refresh (=0 seconds) JavaScript redirects Temporary Redirects Server-Side Client-Side HTTP 302 Meta refresh (>0 seconds) HTTP 303 HTTP refresh (>0 seconds) HTTP 307 Where you mightiness find redirects Server-Side Client-Side Server-level HTML DNS-level HTTP Header Response CDN-level CDN-level (in circumstantial cases) Permanent redirects
HTTP 301
HTTP 308
JavaScript redirects
// Redirect to a caller URL
window.location.href = "https://example.com/new-page";
</script>Meta refresh (=0 seconds)
HTTP refresh (=0 seconds)
Crypto redirect
Temporary redirects
HTTP 302
HTTP 307
HTTP 303
Meta refresh (>0 seconds)
HTTP refresh (>0 seconds)
Server-side redirects
Server-level
header('Location: https://www.example.com/newurl');
exit();DNS-level
CDN-level
Client-side redirects
HTML
// Redirect to a caller URL
window.location.href = "https://example.com/new-page";
</script>HTTP Header Response
CDN-level (in circumstantial cases)
Redirect HTTP to HTTPS
Use HSTS (to make 307 redirects)
Redirect applicable aged content
Avoid agelong redirect chains
Avoid redirect loops
Avoid overly wide redirects
Watch retired for expired certificates
Keep redirects for astatine slightest 1 year
Don’t hide to redirect different files during a migration
Figuring retired what strategy the redirects are in
Redirects whitethorn hap lone for circumstantial user-agents
Redirects tin propulsion the incorrect presumption codes
Final thoughts