Site does not open: errors 403, 404, 500, 502, 503, 504

First look at the error code — it is shown on the page or in the browser tab. The code tells you where to look.

CodeMeaning
403 Forbiddenaccess denied: file permissions, no index file, a deny rule in .htaccess
404 Not Foundno such file or page
500 Internal Server Error, blank pagean error in PHP code or in .htaccess
502 Bad Gatewaythe site handler did not answer: PHP, a Node.js or Python app stopped
503 Service Unavailablethe site temporarily cannot handle the request
504 Gateway Time-outthe script runs too long

The key: the error log

Almost any 403 and 500 error is explained by the site error log. Open it right after you see the error.

  1. Left menu → "Site logs".
  2. Three dots of your-site.error.log → "View".
Site error log → "View"
Site error log → "View"

The last lines are the latest errors. Each line names the file and the line number where the error happened.

The error log: what exactly broke
The error log: what exactly broke
Log lineWhat to do — below
PHP Fatal error: ... in /var/www/.../e500.php on line 2a code error: file and line
Permission denied ... file permissions deny server accessfile permissions do not allow reading it
.htaccess: Invalid commandan error in .htaccess

500 and a blank page

Error 500 in the browser
Error 500 in the browser
  • The log says PHP Fatal error — a code error: open the named file and line. After a WordPress plugin update, rename the plugin folder in wp-content/plugins — the site opens without it.
  • .htaccess: Invalid command — a wrong directive in .htaccess. Remove the line or rename the file to .htaccess.old and check the site.
  • The site needs another PHP version — change it: PHP version.
  • Out of memory (Allowed memory size exhausted) — raise memory_limit in the site PHP settings.

403 Forbidden

Error 403 in the browser
Error 403 in the browser
  • The log says Permission denied — wrong file permissions. File manager → three dots of the file → "Attributes" → "Permissions": 644 for files, 755 for folders.
  • There is no index.php or index.html in the folder — upload the site files to www/your-domain.
  • Access is denied in .htaccess (Deny from all, Require all denied) or access restriction is on.
Permissions 644 for a file
Permissions 644 for a file

404 Not Found

  • The file is in the wrong place: check that the site is in www/your-domain, not in a subfolder.
  • In WordPress or Laravel every page except the home page gives 404 — the .htaccess with pretty URL rules is missing. In WordPress: "Settings" → "Permalinks" → "Save".

502, 503, 504

  • 504 on a long operation (import, plugin backup) — split it or run it on schedule: Cron. Raise max_execution_time: max_execution_time.
  • 502 on a Node.js or Python site — the app stopped. Check the app *-error.log logs and restart it in the site settings.
  • 502 and 503 on a regular PHP site that last longer than a few minutes — contact support with the site and the time of the error.

Other common errors

  • Error establishing a database connection (WordPress) — wrong database name, user or password in wp-config.php. Compare with "Databases".
  • ERR_TOO_MANY_REDIRECTS — an endless redirect. Often an HTTPS redirect together with Flexible mode in Cloudflare: Cloudflare, HTTPS.
  • This site can’t be reached — the domain does not point to the hosting. Check DNS: DNS records.

If you cannot find the cause, contact support: the page address, the error code, the time and what you changed before the error.

Questions and answers
"Site logs" → your-site.error.log → "View". The last lines name the file and line of the error.
Files — 644, folders — 755.
Rename the plugin folder in wp-content/plugins — WordPress disables it and the site opens. Then update or replace the plugin.