HTTP errors 403, 404, 500, 502, 503 and 504: what each one means
· The AYT team · 8 min read

HTTP errors are codes the server uses to say why it couldn't show a page. Those starting with 4 (403, 404) point to a problem with the request: the page doesn't exist or access is forbidden. Those starting with 5 (500, 502, 503, 504) point to a problem on the server. A 502 Bad Gateway error, for example, means the web server (usually nginx) didn't get a valid response from the program that builds the page, which is PHP.
HTTP errors at a glance
| Code | Name | What it means | Where the problem usually is |
|---|---|---|---|
| 403 | Forbidden | the server understood the request but refuses access | file permissions, security rules, a blocked IP |
| 404 | Not Found | there's no page at the requested address | a wrong link, a deleted page, broken permalinks |
| 500 | Internal Server Error | an error in the site's code | a plugin, the theme, memory, configuration |
| 502 | Bad Gateway | the web server got no valid response from PHP | PHP stopped, stuck or out of memory |
| 503 | Service Unavailable | the service is temporarily unavailable | maintenance, an overloaded server, a request limit |
| 504 | Gateway Timeout | PHP answered too late | a slow script, a slow query, an external service not responding |
A simple rule: if the error only happens to you, start with your browser and network (cache, extensions, VPN). If it happens to everyone, the problem is on the site or the server.
403 Forbidden error
The server received the request but won't let you see the resource. Usual causes:
- Wrong permissions on files or folders. For WordPress, the usual values are
644for files and755for folders. - A folder has no index file (
index.phporindex.html), and directory listing is switched off, as it should be. - A web application firewall (WAF) or a security plugin blocked the request because it looked like an attack. This often happens when you save text containing code in wp-admin.
- Your IP was blocked after too many failed sign-in attempts.
- Access rules in the server configuration, such as
deny allon a folder.
What to do: check whether the error also appears on another network (mobile data). If it doesn't, your IP is blocked. If it does, look in the server's error log, which usually states the reason for the refusal. On nginx servers, .htaccess rules aren't read at all, so a rule copied from there has no effect; the details are in our guide to .htaccess on nginx. For Laravel applications there's a separate guide to the 403 error in Laravel.
404 Not Found error
The server works, but there's nothing at the requested address. For a page you deliberately deleted, 404 is the right answer.
The problem is when pages that do exist return 404. On WordPress, the most common cause is permalinks: after a move or a server change, the home page works and posts return 404. In wp-admin, open Settings → Permalinks and click Save Changes without changing anything; the full steps are in our guide to 404 errors in WordPress.
If you changed page addresses, add 301 redirects from the old addresses to the new ones, so visitors and Google don't hit a 404. How to do that is in our guide to 301 redirects in WordPress. Google Search Console shows the pages returning 404 in its indexing section.
500 Internal Server Error
The site's code hit an error the server can't explain to the visitor. On a WordPress site, the usual causes are:
- a recently updated plugin or theme, incompatible with the PHP version or with each other;
- PHP memory exhausted (
Allowed memory size exhaustedin the log); - a syntax error in a file edited by hand, such as
functions.phporwp-config.php; - a PHP version too new or too old for the code.
What to do: open the PHP error log. The line with PHP Fatal error tells you the file and, usually, the plugin at fault. Deactivate that plugin (by renaming its folder in wp-content/plugins) and check again. The detailed steps are in our guide to the WordPress 500 error, and for memory, in our guide to increasing memory_limit. For other platforms: the PrestaShop 500 error and the Laravel 500 error after a deploy.
502 Bad Gateway error
Two programs sit between the visitor and the site's code. The web server (nginx) receives the request and passes it to PHP-FPM, which runs the code. A 502 happens when nginx doesn't get a valid response from PHP: the PHP process stopped, was killed, or can't be reached.
Usual causes:
- PHP-FPM stopped or is restarting, for example after a configuration change;
- a PHP process went over the account's memory and the system stopped it;
- a PHP extension that crashes on certain requests (it usually shows in the log too);
- a CDN or proxy (Cloudflare) gets no response from the server. In that case Cloudflare shows its own 502 page or a code in the 52x range.
What to do: reload the page after a minute. If the 502 appeared once and went away, PHP probably restarted. If it keeps happening, check the resource graphs to see whether you're hitting the memory limit, and look in the error log for messages like upstream prematurely closed connection. On your own server, restart PHP-FPM; on hosting, write to your host with the exact time of the error.
503 Service Unavailable error
The server says the service is temporarily unavailable. Usual causes:
- WordPress is in maintenance mode. During an update, WordPress creates a
.maintenancefile in the site's root. If the update is interrupted, the file stays and the site shows "Briefly unavailable for scheduled maintenance". Delete the file and the site comes back. - All of the account's PHP processes are busy, and new requests have nowhere to go.
- A per-IP request limit: a bot or a testing tool sent too many requests in a short time. Sometimes the limit answers with 429 Too Many Requests instead of 503.
- The server is in planned maintenance, announced by the host on its status page.
If 503 shows up at traffic peaks, the site needs a page cache, so most visits never reach PHP. Our guide to the slow WordPress site shows where the time goes.
504 Gateway Timeout error
PHP is working on the request but doesn't finish within the time the web server waits. Unlike a 502, the process didn't die; it's just too slow.
Usual causes:
- a slow database query, usually from a statistics, filtering or search plugin;
- a script waiting on an external service that doesn't answer (a payment, a courier, an API);
- an import, export or backup started from a wp-admin page instead of running in the background;
- a site under attack, with hundreds of requests a second to
wp-login.phporxmlrpc.php.
What to do: find out which page returns 504 and whether it's always the same one. If it is, the problem is in its code; the PHP slow log shows the function where it hangs. Raising max_execution_time only hides the problem for a while. For big imports, use a cron job or the command line.
Other codes you may see
- 401 Unauthorized: the page requires authentication, such as a password on a folder.
- 410 Gone: the page was deleted for good. Google usually drops it from the index slightly faster than a 404.
- 429 Too Many Requests: you sent too many requests; wait and try again.
- 301 and 302 aren't errors but redirects. A redirect loop shows
ERR_TOO_MANY_REDIRECTSin the browser; the fix is in our guide to ERR_TOO_MANY_REDIRECTS in WordPress.
FAQ
Do 5xx errors hurt my Google ranking?
An error lasting a few minutes, no. If Google often finds 5xx errors on the site, it slows its crawling, and pages that return errors for a long time can drop out of the index. Google Search Console shows the server errors it found.
What's the difference between 502 and 504?
With a 502, PHP didn't answer at all or answered wrongly, usually because the process stopped. With a 504, PHP was still working when the web server gave up waiting.
The error only happens to me. What do I do?
Clear the browser cache, try a private window and another network. If it works on mobile data, your IP has probably been blocked by the firewall after too many sign-in attempts.
Server errors on AYT hosting
On AYT WordPress hosting, sites run on nginx, with isolated PHP for each account, and you can read each site's error log in the panel, on the Errors page. Monitoring checks that the site responds, finds slow plugins and emails you alerts, and the resource graphs show whether an account is hitting its memory or process limits. You change the PHP limits (memory_limit, max_execution_time) and the PHP version per domain in the panel. A 403 can also come from the ModSecurity firewall or from the blocking of IPs that keep guessing passwords; in either case, write to us with the time and the page address.

