HTTP 302 codes are a valuable way to redirect website users to a different URL temporarily. However, if your website is delivering 302 redirects in error, it’s a sign that something’s wrong.
Don’t worry — you can fix this problem — but you’ll need to do some troubleshooting.
The first step is to understand precisely what HTTP 302 codes are, how they work, and why they occur. Once you know that, you can figure out what’s gone wrong and how to make it right.
In this post, we’ll tell you everything you need to know about HTTP 302 errors. Then we’ll share five troubleshooting tips to help you fix them.
Let’s get started!
Check Out Our Video Guide to The 302 HTTP Status Code
What Are HTTP 302 Status Codes?
302 codes are a specific type of HTTP status code. These codes are like “notes” that a server delivers to your browser.
Whenever you click on a link or navigate to a URL, your browser requests the webserver for the same. In return, the server sends back the relevant resource (e.g. the page you’re trying to access) along with an HTTP header. The HTTP status codes are inside that header.
Typically, you can’t see these status codes anywhere on the web page. You’ll only usually see them when an error occurs, or if you’ve installed a browser extension that makes them visible:
3xx status codes (301, 302, etc.) are a class of status codes called “redirection codes.” They’re returned whenever the server sends back a new resource instead of the requested resource.
In other words, they’re shown when the website page you intended to access redirects you to a different page.
The critical difference between code 301 and code 302 is that the former is used for permanent redirects, whereas the latter is for temporary redirects.
The 301 redirects also pass “link juice,” whereas 302s don’t. That has a significant impact on Search Engine Optimization (SEO).
Uh oh… you’ve just seen an HTTP 302 code pop up. 😬 Now what? 🤷♀️ Start with this thorough guide ⤵Click to Tweet
How 302 Redirects Work
When you set up a 302 redirect for a page on your website that’s temporarily unavailable, and a user visits that page, your webserver will respond to the visitor’s browser with a special Location header. This header will indicate the new URL that the browser should redirect the user to instead.
For example, imagine that a user types blog.example.com into their browser URL bar, but the website is configured to redirect it to blogging.example.com.
The server response will include both the 302 status code and the Location: blogging.example.com header. This setting tells the user’s browser to redirect this request to the new URL instead.
Of course, all of this happens automatically and behind the scenes. The user shouldn’t be able to see any of this play out. Instead, their browser should automatically take them to the new resource.
Why HTTP 302 Errors Happen
If something is misconfigured on your website, it might cause 302 codes to be issued in error. If this happens, you may run into problems such as:
- A page on your website that redirects your visitors elsewhere when it shouldn’t
- A page on your website that redirects your visitors to the wrong resource
- The ERR_TOO_MANY_REDIRECTS error (also known as a “redirect loop”)
The last of these issues is the only one that will display an actual error page. If you’re using the Chrome browser, a redirect loop error page will look something like this:
On Mozilla Firefox, it looks like this:
All of the above problems are caused by some misconfiguration. It may be a plugin conflict, incorrect URL settings, or a misconfigured .htaccess file.
How to Fix the HTTP 302 Error (5 Methods)
Next, we’ll walk you through five troubleshooting methods that can help you figure out what’s causing the problem and fix it.
Before we get started, make sure to perform a complete backup of your website first. That way, if anything goes wrong, you can always revert to the previous version. You can use a WordPress plugin to do this.
1. Determine Whether the Redirects Are Valid
302 responses are usually not errors. Temporarily redirecting users to a different page can be a valid configuration and isn’t usually something that requires fixing.
It’s only an error if your website is responding with 302 codes that it shouldn’t be issuing, or if it’s causing a redirect loop. Therefore, the first step is to double-check which URLs are generating the HTTP 302 codes and determine whether the redirect is appropriate or not.
To do so, you can navigate to the pages on your website you suspect of issuing the 302 error and see for yourself if they behave as expected. If a temporarily unavailable page redirects to the correct resource, it’s appropriately configured.
However, if a page redirects you to the wrong resource or your browser reports a redirect loop by bringing up an ERR_TOO_MANY_REDIRECTS error page, it’s a sign that one (or more) of your redirects isn’t configured quite right.
2. Check Your Plugins
One of the most common causes of 302 errors and redirect loops is plugins.
Some WordPress redirect manager plugins and SEO tools like Yoast SEO manage your website redirects for you and enable you to set up redirect rules:
If these rules are misconfigured, or if two plugins conflict, it can cause unexpected issues. Therefore, you’ll need to check each relevant tool that’s installed on your site.
For example, if you’re using the popular 301 Redirects WordPress plugin, you can check the configuration by navigating to Settings > 301 Redirects. Under Redirect Rules, you’ll see a list of all the redirect rules you’ve set up:
Check all the 302 redirects listed here, and make sure they’re all correct.
You’ll also want to ensure that you haven’t set up anything in a way that could cause a redirect loop. For example, if Page-A is set to redirect to Page-B, but Page-B is also set to redirect to Page-A, this will cause an error.
If you have multiple redirect manager plugins and you’re not sure which one is causing the issue, you can try deactivating them one by one from the WordPress Plugins page (be sure to make a backup first):
After deactivating each plugin, try revisiting the problem URL to see if the 302 error persists.
If the problem is suddenly fixed, you’ll know which plugin was causing the issue, and you can then choose to troubleshoot further or remove it from your site.
3. Ensure That Your WordPress URL Settings Are Configured Correctly
Another common cause of the HTTP 302 error is a misconfiguration in the WordPress URL settings.
To check this, navigate to Settings > General in your WordPress dashboard. Here, you should see a WordPress Address (URL) field and a Site Address (URL) field:
In most cases, the URLs in both of these fields should match. Make sure they’re both the same, including the “www” portion (or lack thereof) before the domain name.
If they don’t match, update the settings, then check the URL of the page issuing the HTTP 302 error to see if it’s fixed.
4. Check Your Server Configuration
A misconfigured server can also sometimes cause 302 redirect errors. Therefore, the next step is to check your server configuration.
If your host uses the Apache webserver, you can do this by checking your.htaccess file.
First, connect to your site’s server via a control dashboard like cPanel or an FTP client. Then navigate to the root directory of your site — the same place as the wp-admin and wp-content folders — and find the .htaccess file:
If you aren’t finding the .htaccess file here (and you’re sure on an Apache server), you may need to tell FileZilla to show hidden files before it’ll appear in the file list.
Next, open the file in your favorite text editor. It should look something like this:
Now, we’re going to look for RewriteXXX directives (the highlighted elements above). Without getting too technical, RewriteCond and RewriteRule directives are used to perform redirections from one URL to another.
The RewriteCond directive specifies the URL you want to redirect the visitor away from, while the RewriteRule directive specifies the URL you want to redirect them to. Here’s an example:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^website.com$
RewriteRule ^(.*)$ http://www.temporary-website.com/$1 [R=302]
The flag at the end, “[R=302]”, tells the browser that this is a temporary 302 redirect.
If you notice any RewriteXXX combinations similar to the above in your .htaccess file that shouldn’t be there, you can comment them out, save the changes, and reload the problem web page to see if it resolves the issue.
Just make sure to download and save a spare copy of your .htaccess file before you make any changes in case something goes wrong.
5. Speak to Your Web Host
If you’ve tried all of the above methods and you’re still having trouble, the next step is to speak to your web host.
Troubleshooting a 302 code error beyond this point requires a lot of technical know-how. Therefore, unless you’re a professional developer, it’s probably best to get help from an expert.
At Kinsta, we take support seriously. Our team of experts is always on-hand to help you resolve issues like this whenever they arise:
We’re available 24/7. All you have to do is log in to your MyKinsta account and contact us via live chat to connect with a support engineer who can help in real-time.
Don’t let HTTP 302 codes slow your roll. 🙅♀️ Learn how to resolve them with these 5 troubleshooting tips 💥Click to Tweet
Summary
HTTP 302 status codes are a completely normal way to redirect your website visitors. However, they should only be used when the resource page is temporarily unavailable.
Suppose your website is issuing 302 codes in error or causing redirect loops. In that case, it’s vital to fix this problem as soon as possible, or it may negatively impact your SEO and conversions.
You can follow these five steps to fix HTTP 302 errors on your website:
- Determine whether the redirects are appropriate or not by examining the URLs that are issuing the 302 redirects.
- Check your plugins to make sure any redirect settings are valid.
- Ensure that your WordPress URL settings are configured correctly.
- Check your server configuration by looking for incorrect
RewriteXXXdirectives in your .htaccess file (Apache servers only). - Speak to your web host for further technical support if the problem persists.
Do you have any questions left about the HTTP 302 error? Let us know in the comments section.
From Wikipedia, the free encyclopedia
The HTTP response status code 302 Found is a common way of performing URL redirection. The HTTP/1.0 specification (RFC 1945) initially defined this code, and gave it the description phrase «Moved Temporarily» rather than «Found».
An HTTP response with this status code will additionally provide a URL in the header field Location. This is an invitation to the user agent (e.g. a web browser) to make a second, otherwise identical, request to the new URL specified in the location field. The end result is a redirection to the new URL.
Many web browsers implemented this code in a manner that violated this standard, changing the request type of the new request to GET, regardless of the type employed in the original request (e.g. POST).[1] For this reason, HTTP/1.1 (RFC 2616) added the new status codes 303 and 307 to disambiguate between the two behaviours, with 303 mandating the change of request type to GET, and 307 preserving the request type as originally sent. Despite the greater clarity provided by this disambiguation, the 302 code is still employed in web frameworks to preserve compatibility with browsers that do not implement the HTTP/1.1 specification.[2]
As a consequence, RFC 7231 (the update of RFC 2616) changes the definition to allow user agents to rewrite POST to GET.[3]
Example[edit]
Client request:
GET /index.html HTTP/1.1 Host: www.example.com
Server response:
HTTP/1.1 302 Found Location: http://www.iana.org/domains/example/
See also[edit]
- List of HTTP status codes
- HTTP 301
References[edit]
- ^ Lawrence, Eric. «HTTP Methods and Redirect Status Codes». EricLaw’s IEInternals blog. Retrieved 2011-08-20.
- ^ «Request and response objects | Django documentation | Django». Docs.djangoproject.com. Retrieved 2014-06-23.
- ^ «Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content». Tools.ietf.org. Retrieved 2019-01-05.
External links[edit]
- RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235 (HTTP 1.1)
- RFC 2616 (HTTP 1.1) (obsolete)
- RFC 1945 (HTTP 1.0)
This question was asked a long ago, while the RFC 2616 was still hanging around. Some answers to this question are based in such document, which is no longer relevant nowadays. Quoting Mark Nottingham who, at the time of writing, co-chairs the IETF HTTP and QUIC Working Groups:
Don’t use RFC2616. Delete it from your hard drives, bookmarks, and burn (or responsibly recycle) any copies that are printed out.
The old RFC 2616 has been supplanted by the following documents that, together, define the HTTP/1.1 protocol:
- RFC 7230: Message Syntax and Routing
- RFC 7231: Semantics and Content
- RFC 7232: Conditional Requests
- RFC 7233: Range Requests
- RFC 7234: Caching
- RFC 7235: Authentication
And, as of June 2022, a new set of RFCs obsoleted the documents listed above:
- RFC 9110: HTTP Semantics
- RFC 9111: HTTP Caching
- RFC 9112: HTTP/1.1
So I aim to provide an answer based in the RFC 9110, which is the current reference for the HTTP semantics.
The 302 status code
A response with 302 is a common way of performing URL redirection. Along with the 302 status code, the response should include a Location header with a different URI. Such header will be parsed by the user agent and then perform the redirection:
Web browsers may change from POST to GET in the subsequent request. If this behavior is undesired, the 307 (Temporary Redirect) status code can be used instead.
This is how the 302 status code is defined in the RFC 9110:
6.4.3. 302 Found
The
302(Found) status code indicates that the target resource
resides temporarily under a different URI. Since the redirection
might be altered on occasion, the client ought to continue to use the
target URI for future requests.The server SHOULD generate a
Locationheader field in the response
containing a URI reference for the different URI. The user agent MAY
use theLocationfield value for automatic redirection. The server’s
response content usually contains a short hypertext note with a
hyperlink to the different URI(s).Note: For historical reasons, a user agent MAY change the
request method fromPOSTtoGETfor the subsequent request. If
this behavior is undesired, the307(Temporary Redirect) status
code can be used instead.
According to MDN web docs from Mozilla, a typical use case for [302]302] is:
The Web page is temporarily not available for reasons that have not been unforeseen. That way, search engines don’t update their links.
Other status codes for redirection
The RFC 9110 defines the following status codes for redirection (some of these status codes were originally defined in other RFCs, but have all been consolidated in the RFC 9110):
301: Moved Permanently302: Found307: Temporary Redirect308: Permanent Redirect
Refer to this answer for further details.
HTTP response status code 302 Found, also previously known as “Moved Temporarily», is returned by the server to indicate that the client redirects to a new location specified within the Location HTTP header, because HTTP response is temporary it is expected to be revalidated upon the next time the URI is requested.
Usage
When the 302 Found status code is received, the client will understand that the requested resource has temporarily moved to a new location. As such, it can make a second HTTP request to fetch the resource to continue processing the original HTTP request. This is somewhat simpler than a 301 Moved Permanently status code because the client is not expected to take action such as updating internal links.
Note
For backward compatibility, the client may change the HTTP request method from POST to GET for the subsequent HTTP request. However, this is not recommended. To remove ambiguity, the server can return an alternative status code. The 303 See Other status code indicates that the HTTP request must change to a HTTP GET method, whereas the 307 Temporary Redirect status code stipulates that the HTTP request method has to be preserved for the subsequent HTTP request.
Note
Search engines may interpret an URI returning a 302 Found status code over a prolonged period of time as equal to the 301 Moved Permanently status code and treat it as such.
Example
In the example, the client requests a resource that has been temporarily moved. The server indicates the new location and supplies a relevant message that can be displayed on the client-side.
Request
GET /news.html HTTP/1.1
Host: www.example.ai
Response
HTTP/1.1 302 Found
Location: http//www.example.ai/testing/news.html
Content-Type: text/html
Content-Length: 167
<h1>The Newsfeed has moved</h1>
<body>
The site is currently under development and the newsfeed has temporarily moved to <a href=/testing/news.html>here</a>.
</body>
Code references
.NET
HttpStatusCode.Found
Rust
http::StatusCode::FOUND
Rails
:found
Go
http.StatusFound
Symfony
Response::HTTP_FOUND
Python3.5+
http.HTTPStatus.FOUND
Java
java.net.HttpURLConnection.HTTP_MOVED_TEMP
Apache HttpComponents Core
org.apache.hc.core5.http.HttpStatus.SC_MOVED_TEMPORARILY
Angular
@angular/common/http/HttpStatusCode.Found
Takeaway
The 302 Found status code indicates that the requested resource has been temporarily moved and that a second, otherwise identical HTTP request has to be made to fetch the resource. As the requested resource has moved temporarily, the URI has to be revalidated upon the next time the resource is requested.
See also
- 303 See Other
- 307 Temporary Redirect
- RFC 7231
Last updated: June 29, 2022
If you’ve spent any time on the internet, chances are you’ve encountered an HTTP status code.
In simple terms, HTTP status codes are standard response codes that show the relationship between all the things that go on in the background when you travel from web page to web page. Things like the user agent (i.e., your web browser), the server, the web page you’re trying to load, and any third-party web applications you might be running.
Because of the complexity of how all those elements interact, there are many possible HTTP status codes you can run up against.
HTTP status codes identify and diagnose the particular blocker preventing you from loading a resource, and can give you information about the journey you took on the way to a page.
In this article, we’ll cover what you need to know about the HTTP 302 status code – jargon-free.
What is an HTTP 302?
The 302 status code is a redirection message that occurs when a resource or page you’re attempting to load has been temporarily moved to a different location. It’s usually caused by the web server and doesn’t impact the user experience, as the redirect happens automatically.
For starters, it’s helpful to know that all HTTP messages with 3xx are redirection messages.
Say blog.hubspot.com no longer exists, and the content is now permanently housed on blogging.hubspot.com. This would trigger a 301 status code, which indicates a permanent redirection from one location to another.
The 302 redirect, on the other hand, is only temporary. A good example of when to use a 302 status code is for localization and language purposes.
For instance, if you visit a clothing website based in the United Kingdom but you are located in the United States. A 302 redirect would send you to the US version of the site to ensure the currency and other content are displayed correctly, according to your location.
You can also use a 302 status code when:
- Redesigning a page – You can send users to a temporary location while the other page is under construction.
- Conducting A/B tests – Want to test a new page and get feedback on its performance? You can do this with a 302 redirect without hurting your ranking.
- Running a promotion – To drive traffic to a particular offer, you can set up a temporary redirect for a page that usually includes other content.
- A product is sold out – In the case of a sold-out or temporarily unavailable product, you can redirect users to a related page until it is available again.
While this list is not exhaustive, here’s the golden rule to keep in mind: Only use a 302 redirect if the change is temporary.
Furthermore, a 302 status code happens on the server-side and shouldn’t be noticed by users if set up correctly. The web server serving up the 302 redirect will immediately indicate the new location of the page to your browser (and search engines) and should send users there right away.
How a 302 Status Code Affects SEO
From an SEO perspective, it’s important to understand how a 302 status code can impact your ranking and when you should use it.
Because of the complexity of how all those elements interact, there are many possible HTTP status codes you can run up against.
HTTP status codes identify and diagnose the particular blocker preventing you from loading a resource, and can give you information about the journey you took on the way to a page.
In this article, we’ll cover what you need to know about the HTTP 302 status code – jargon-free.
What is an HTTP 302?
The 302 status code is a redirection message that occurs when a resource or page you’re attempting to load has been temporarily moved to a different location. It’s usually caused by the web server and doesn’t impact the user experience, as the redirect happens automatically.
For starters, it’s helpful to know that all HTTP messages with 3xx are redirection messages.
Say blog.hubspot.com no longer exists, and the content is now permanently housed on blogging.hubspot.com. This would trigger a 301 status code, which indicates a permanent redirection from one location to another.
The 302 redirect, on the other hand, is only temporary. A good example of when to use a 302 status code is for localization and language purposes.
For instance, if you visit a clothing website based in the United Kingdom but you are located in the United States. A 302 redirect would send you to the US version of the site to ensure the currency and other content are displayed correctly, according to your location.
You can also use a 302 status code when:
- Redesigning a page – You can send users to a temporary location while the other page is under construction.
- Conducting A/B tests – Want to test a new page and get feedback on its performance? You can do this with a 302 redirect without hurting your ranking.
- Running a promotion – To drive traffic to a particular offer, you can set up a temporary redirect for a page that usually includes other content.
- A product is sold out – In the case of a sold-out or temporarily unavailable product, you can redirect users to a related page until it is available again.
While this list is not exhaustive, here’s the golden rule to keep in mind: Only use a 302 redirect if the change is temporary.
Furthermore, a 302 status code happens on the server-side and shouldn’t be noticed by users if set up correctly. The web server serving up the 302 redirect will immediately indicate the new location of the page to your browser (and search engines) and should send users there right away.
How a 302 Status Code Affects SEO
From an SEO perspective, it’s important to understand how a 302 status code can impact your ranking and when you should use it.
Firstly, if the location of a page has changed and a redirect has not been set up, this can lead to a 404 status error (i.e., your page cannot be found) and affect your ranking. After all, Google won’t want to send users to a page that leads to nowhere.
One benefit of using a redirect like this is that you don’t have to sacrifice your ranking when you temporarily send users elsewhere.
Say you’re using it to redirect users from a sold-out product page to a relevant product page. You wouldn’t want your unavailable product’s page to drop in ranking, just because it’s currently unavailable. With a 302 status code, you can maintain your ranking.
However, this also means that your temporary URL will not benefit from any link juice because Google knows it won’t be there long.
For comparison, a 301 code typically sends most link equity to your new URL, but your page can experience some drop in ranking as a result of the redirect.
How to Identify & Implement an HTTP 302 Error
If you want to see when you’ve encountered a 302 redirect (or any type of redirect), consider using an application or Chrome extension (like this one, Redirect Path). This type of tool will show you directly in your browser when you run into a redirect. Tools like Pulsetic can be used to monitor websites and send alerts for server or website errors.
You can also view and implement the code from the backend by accessing your .htaccess file. To avoid accessing this file, you can also install a redirect manager plugin or an SEO tool that includes a redirect manager (like Yoast SEO Premium).
Overall, you want to make sure you understand how redirection messages affect SEO. A 302 status code can be a great strategy when making temporary changes to your website, like testing new website features and product promotions.
So, when you’re debating between various redirection messages, make sure the one you choose aligns with your long-term strategy.













![Download Now: SEO Starter Pack [Free Kit]](https://no-cache.hubspot.com/cta/default/53/1d7211ac-7b1b-4405-b940-54b8acedb26e.png)
