Website errors are frustrating, but most have straightforward causes and solutions. This guide covers the most common HTTP error codes and how to resolve them.
403 Forbidden
Meaning: The server understood your request but refuses to authorize it.
Common Causes:
- Incorrect file or directory permissions
- Missing index file (index.html or index.php)
- IP address blocked by firewall or .htaccess rules
- .htaccess syntax error or restrictive rules
Solutions:
- Set file permissions to 644 and directory permissions to 755.
- Ensure an index file exists in the directory.
- Check .htaccess for any Deny directives blocking access.
- Verify your IP is not blocked in the firewall.
404 Not Found
Meaning: The requested page or file does not exist on the server.
Common Causes:
- Typo in the URL
- File was moved or deleted
- Incorrect permalink settings (WordPress)
- Broken internal links
Solutions:
- Verify the URL is correct and the file exists.
- For WordPress, go to Settings then Permalinks and click "Save" to regenerate rewrite rules.
- Set up a custom 404 page to help visitors find what they need.
- Use a broken link checker to find and fix internal links.
500 Internal Server Error
Meaning: A general error occurred on the server.
Common Causes:
- Syntax error in .htaccess file
- PHP script error or fatal error
- Exceeded PHP memory limit
- File permission issues
- Corrupted WordPress plugin or theme
Solutions:
- Rename .htaccess to .htaccess.bak and test. If the site works, the issue is in .htaccess.
- Check the error log in your control panel for specific error messages.
- Increase the PHP memory limit.
- Deactivate recently installed plugins or themes (rename the plugin folder via FTP).
- Verify file permissions (644 for files, 755 for directories).
502 Bad Gateway
Meaning: The server acting as a gateway received an invalid response.
Common Causes:
- PHP-FPM process crashed or is overloaded
- Server resource limits exceeded
- Temporary server issue
Solutions:
- Wait a few minutes and try again.
- Check if your site is exceeding resource limits.
- Contact support if the error persists.
503 Service Unavailable
Meaning: The server is temporarily unable to handle the request.
Common Causes:
- Server is under maintenance
- Server is overloaded
- Application is restarting
Solutions:
- Wait a few minutes and try again.
- Check for any maintenance notifications from your hosting provider.
- If persistent, contact support.
408 Request Timeout
Meaning: The server timed out waiting for the request.
Common Causes:
- Slow internet connection
- Large file upload exceeding time limits
- Long-running PHP script
Solutions:
- Increase PHP max_execution_time.
- Optimize slow database queries.
- Upload large files via FTP instead of browser.