Whenever a browser makes a request to a website like opening a page or fetching data, then the server returns an HTTP status code. These codes indicate the status of the server’s response like success, redirection, client error, or server error. In this blog, we will understand these HTTP status codes. Let’s get started!
What are HTTP Status Codes?
They are three-digit numbers that servers send to browsers to indicate how a request was processed. The codes are part of the Hypertext Transfer Protocol (HTTP) that governs how data is exchanged between clients and servers. Let’s know the 200, 300, 400, and 500 codes.
1. 200 Series (Success Codes)
These status codes are returned when the server successfully processes a request. Here are the types of 200 series codes.
1. 200 OK:
It means a request is successfully completed. For example, if you open a website: www.example.com, and the page loads correctly without any problem, the server returns 200 OK. There is no fix needed. If you need to ensure that a page returns 200 OK, you can check it by using the browser DevTools or SEO tools.
2. 201 Created
This means that a new resource has been created from the request. For example, when you publish a new blog post in WordPress, the server returns the code 201 Created. You need to ensure the server response headers return the 201 code when a resource is successfully created.
3. 204 No Content
This means the request was successful but there is no response content. For example, when you submit a form and the page does not refresh, the server may return 204. You need to ensure that if content needs to be displayed, the server returns 200 instead.
Also Read: How Robots.txt, HTTPS, and SSL/TLS Impact Website Security & SEO?
2. 300 Series (Redirection Codes)
1. 301 Moved Permanently
This code means a page has been permanently shifted to a new URL. For example, if you want to move http://example.com to https://example.com permanently, a 301 redirect is implemented. This can be done using .htaccess or server settings to ensure users and search engines are directed to the correct location.
2. 302 Found (Temporary Redirect)
This code means a page is temporarily redirected to another URL. For instance, if a maintenance mode plugin is activated, it may redirect users to a different page temporarily. If the URL change is permanent, a 301 redirect should be used instead of 302.
3. 307 Temporary Redirect
This code is similar to 302 but ensures that the request method (GET/POST) remains unchanged. For example, if you submit a contact form using a POST request and the page redirects, the server may return a 307 status instead of 302 to maintain the same request type.
4. 308 Permanent Redirect
This code is an advanced version of 301 which also preserves the request method. For example, if you move example.com/blog to example.com/articles but want to keep the request method unchanged then 308 is the correct choice. Redirect rules should be properly set in server configurations or .htaccess files to ensure smooth functionality and SEO optimization.
Also Read: A Complete Guide to Sitemap, Types, and its Importance
3. 400 Series (Client Errors)
These errors occur when there is an issue with the user’s request, such as an incorrect URL or an authorization problem.
1. 400 Bad Request
This means the request is incorrect or improperly formatted. For example, if you enter an invalid URL with spaces or special characters, like www.example.com/hello world, then in this case, the server may return a 400 error. To fix this, ensure the URL syntax is correct and try clearing the browser cache.
2. 401 Unauthorized
The 401 Unauthorized code means that authentication is required to access the requested resource. For instance, if you try to access an admin panel without logging in, the server may return a 401 Unauthorized error. To resolve this, use the correct login credentials or enter the right API key if accessing an API.
3. 403 Forbidden
A 403 Forbidden error occurs when access to a resource is denied. For example, if you attempt to open a private page or a restricted directory, you will receive a 403 error. To fix this, check file permissions and update server settings to allow access where necessary.
4. 404 Not Found
This code means that the requested page or resource does not exist. For example, if you visit www.example.com/old-page and that page has been deleted, the server will return a 404 error. To fix this, create a custom 404 error page and use 301 redirects for deleted pages that have been moved to a new location.
5. 405 Method Not Allowed
The 405 code is displayed when the HTTP request method is not permitted for the requested resource. For example, if an API endpoint only allows GET requests, but you send a POST request, then in this case, the server will return a 405 error. To fix this issue, you need to ensure that you are using the correct request method as required by the server or API.
6. 429 Too Many Requests
This code is shown when a user sends too many requests in a short period. For example, if you refresh a website too frequently then the server might return a 429 error in order to prevent overload. To fix this issue, you need to implement rate-limiting on the server or reduce the number of requests being sent.
Common Permission Examples:
Permission | Symbolic | Numeric | Meaning |
Read & Write | rw- | 6 | Can read and edit the file |
Read, Write, Execute | rwx | 7 | Can read, edit, and run the file |
Read-only | r– | 4 | Can only view the file |
Full Access | rwxrwxrwx | 777 | Everyone has full access (⚠ Security risk) |
Also Read: How to Improve Core Web Vitals for Better SEO and User Experience
4. 500 Series (Server Errors)
These errors occur when the server is unable to process a request due to internal issues or miscommunication with other servers.
1. 500 Internal Server Error
This code is shown when the server encounters an unknown issue that prevents it from fulfilling the request. For example, if you install a plugin on WordPress and it conflicts with existing configurations then the server may return a 500 error. To fix this, check the error logs and ensure the .htaccess file is correctly configured, and restart the server if necessary.
2. 502 Bad Gateway
A 502 Bad Gateway error occurs when a server receives an invalid response from another server it relies on. For example, if your website uses Cloudflare but the backend server is down, a 502 error may appear. To resolve this, you need to check with your hosting provider or restart the backend server to restore normal functionality.
3. 503 Service Unavailable
A 503 Service Unavailable error indicates that the server is temporarily unable to handle requests, usually due to high traffic or maintenance. For instance, if your website is experiencing a surge in visitors or undergoing maintenance, a 503 error may be displayed. To fix this, you need to manage server load effectively and minimize downtime by optimizing resources.
4. 504 Gateway Timeout
A 504 Gateway Timeout error occurs when a server does not receive a response from another server within a set time limit. If a website is running slowly and a proxy server fails to get a response in time, the server may return a 504 error. To resolve this issue, you should increase server timeout settings or consider upgrading hosting resources for better performance.
Also Read: What is Technical SEO & How to Optimize for Google Rankings?
Ways to Check HTTP Status Codes
- Browser DevTools: Open Chrome, press F12, and check the Network Tab.
- SEO Tools: Use tools like Ahrefs, Screaming Frog, or Google Search Console to identify errors.
- Command Line (cURL) → Open Terminal or CMD and run:
curl -I https://example.com to check the status code.
Conclusion
At last, you might have understood that:
- 200 series: Everything is working fine.
- 300 series: Redirects need to be managed.
- 400 series: Client-side errors occur.
- 500 series: Server-side problems exist.
Stay tuned for more informative blogs that will help you learn SEO. You can even opt for the courses by Skillwaala by joining the live classes on YouTube. You can also watch our YouTube live sessions later by downloading it. Our content is lifetime available for FREE. Moreover, all the courses by Skillwaala are absolutely FREE with certification!! Enroll now!