308 Permanent Redirect
What is a 308 Permanent Redirect and how do you fix it? Here's how to deal with the status code without causing further damage to your website.
As a website owner, you’ve probably heard of 301 redirects.
But have you ever come across a 308 Permanent Redirect status code?
Those are less well-known but could be just as crucial to your marketing efforts.
Here's everything you should know about the 308 Permanent Redirect status code and proven strategies for fixing it without causing further damage to your website.
What Is a 308 Permanent Redirect?
308 Permanent Redirect is similar to 301 Moved Permanently, which indicates that the resource the user tried to access has moved to a new URI.
The 308 is relatively new and has been recently added to the RFC7238 specification to fill in the gap left with similar codes like 301, 302, and 307.
Is It a Server Side Error?
Before we answer this question, let's first take a look at how the internet works.
There are two main players on the internet: servers and clients.
Let's say that you're using your browser to open a web page. You're accessing the internet through a web client.
The web client sends a message to the server with your request to access the web page. The server returns an HTTP status code every time you make a request to your server to access a resource.
That status code can be a successful request, a client error, or a server error. In fact, there are five groups of HTTP response status codes, including:
- 1xx status codes: Informational requests
- 2xx status codes: Successful requests
- 3xx status codes: Redirects
- 4xx status codes: Client errors
- 5xx status codes: Server errors
Although somewhat different, they all inform a user whether a specific HTTP request has been successfully completed.
The 308 Permanent Redirect that we're looking into today belongs to the 3xx status codes group or the redirects. Some status codes in the group – like the 301 Moved Permanently and the 307 Temporary Redirect – can directly affect the user experience and the SEO health of your site.
To compare, the status codes in the 4xx group – like the 404 Not Found error – indicate there's an error on the client-side of things. The 5xx status codes, on the other hand, indicate that something on the server-side of things is the cause of the problem.
Since the 308 Permanent Redirect indicates that something on the server-side of things is the issue, we can entirely ignore the client-side of things.
What Is the Difference Between 301, 302, 307, and 308 Redirects?
- 301 Moved Permanently: The 301 redirect is one of the most common redirects. It indicates that the resource has been permanently moved and request method conversion from POST to GET is allowed. You should use this redirect if you want to redirect a moved or a deleted page permanently or if you have changed the structure of your permalinks. Make sure you always add a 301 redirect to your deleted or moved pages to avoid a 404 error.
- 302 Found: The 302 redirect is a temporary redirect that redirects users and search engines to a different page for a limited amount of time. It indicates that the resource has been temporarily moved and request method conversion from POST to GET is allowed. Use this redirect when you're redesigning or updating your website.
- 307 Temporary Redirect: A 307 Temporary Redirect is the HTTP 1.1 successor of the 302 redirects. It indicates that the resource has been temporarily moved and request method conversion from POST to GET is forbidden.
- 308 Permanent Redirect: As you can see from the list above, this set of codes is missing a status code that indicates a permanent redirect that forbids POST to GET conversion. This is the role of the 308 status code.
How Do You Fix a 308 Permanent Redirect Response Code?
If your website is generating a 308 Permanent Redirect response code, here are some steps you can take to diagnose and fix the issue.
Perform a Thorough Application Backup
This tip is more like safety advice than a strategy for fixing the code. If you don't want to cause further damage to your website, you must create a copy of it onto a secondary server that isn't live or otherwise active.
Do a full backup before you try to fix the issue and change the system. This gives you a clean test ground to test all potential fixes without damaging the security of your live application.
Confirm Your Server Configuration
The first 'real' tip on the list is to check if there are any unintentional redirect instructions in your web server's configuration files.
Your application is either running on Apache or Nginx web servers. If it's on an Apache server, then both apache_server and .htaccess need to be checked.
If you're using Nginx, only one file needs checking: namely, nginx_conf_. After you locate the files, search for a 308 status code and see if anything appears. If it does, you need to modify it. You either want to remove it entirely if you don't need the status code or apply it to a specific page.
Debug Your Application Code
Nearly every web application keeps some form of server-side logs. Application logs are usually the history of what the application did while running a website.
If the troubleshooting tip above didn't help fix the issue, the root of the problem may be in some custom code within your application.
To see if this is the case, you have to debug your application code manually. Perform a step-by-step debug process to recreate the exact scenario in which the 308 Permanent Redirect occurred and view the application code when something goes wrong.
A 308 Permanent Redirect status code indicates that the resource the user tried to access has moved to a new URI.
The best way to fix the 308 Permanent Redirect status code is to:
- Confirm your server configuration
- Debug your application code
To avoid status codes from negatively affecting your user experience and the SEO performance of your site, you must invest in a good website maintenance tool to help you automatically detect such errors in the future. A tool like Exai can detect an issue the moment it occurs. You can be sure that your website is up-to-date and fully functional so that you can maintain your top web presence.