Every time you visit a website, the server returns an HTTP status code in response to your request. While status codes in the 2xx range (like 200 OK) mean everything is working behind the scenes, codes in the 4xx (client-side) and 5xx (server-side) ranges indicate that something went wrong.
Here is a quick reference guide to the most common HTTP error codes you will encounter, along with actionable steps to solve them.
1. 403 Forbidden
A 403 Forbidden error means the server understands your request, but is actively refusing to authorize access to the requested page or resource.
- Common Causes: Incorrect file permissions on the server (e.g., directories should usually be 755 and files 644), a misconfigured
.htaccessfile, or security plugins/firewalls actively blocking your IP address. - How to Fix (As Visitor): Double-check the URL to ensure it points to a public webpage rather than a private directory. Clear cookies or log out and log back in.
- How to Fix (As Webmaster): Check directory permissions and audit your Web Application Firewall (WAF) or security plugins. Verify Apache/Nginx configuration blocks.
2. 404 Not Found
A 404 Not Found error is the most famous status code. It means the server successfully connected, but could not find the specific path or file requested.
- Common Causes: Typo in the URL, the page was moved or deleted without a redirect, or server URL rewriting configurations (like Apache
mod_rewrite) are disabled. - How to Fix (As Visitor): Check the URL spelling. Use a search bar or sitemap to locate the resource, or head back to the main homepage.
- How to Fix (As Webmaster): Ensure directories contain index files. Configure 301 redirects for modified URLs and check that your server rewriting rules (e.g.
.htaccessor Nginxtry_files) are active.
3. 500 Internal Server Error
A 500 Internal Server Error is a generic catch-all message. It means the server encountered an unexpected condition that prevented it from fulfilling the request.
- Common Causes: PHP syntax errors, corrupt configuration files (like a bad directive in
.htaccess), resource exhaustions, or broken database connections. - How to Fix: Since this is completely server-side, check your host's PHP error logs (e.g.,
error_logfile or syslog) to find the exact line causing the crash.
4. 503 Service Unavailable
A 503 Service Unavailable error means the server is currently unable to handle the request because it is down for maintenance or temporarily overloaded with traffic.
- Common Causes: Server maintenance windows, backend applications crashing under high request volume, or bandwidth throttling.
- How to Fix: Wait a few minutes and reload. If you host the site, check server CPU usage and restart application processes if they are locked.
5. 504 Gateway Timeout
A 504 Gateway Timeout occurs when one server on the internet (like a load balancer or reverse proxy) acts as a gateway and does not receive a timely response from the backend upstream server.
- Common Causes: Slow database queries, external API integrations timing out, or insufficient PHP max execution time limits.
- How to Fix (As Webmaster): Increase execution limits in
php.ini(e.g.,max_execution_time) and proxy connection timeout thresholds in Nginx/Apache configs. Optimize slow backend logic.