Error fixes
How to fix a 502 Bad Gateway error
A 502 Bad Gateway means a gateway or proxy got an invalid response. Fixing it probably needs the site owner or host, unless your own network is the cause.
· Mateo Cardenas
HomeGuidesError fixesWhat does HTTP error 404 (Not Found) mean?
An HTTP 404 Not Found error means the server cannot find the requested resource.1, source 1 The 4xx (Client Error) class of status code indicates that the client seems to have erred.2, source 2 Common causes of 404 responses are mistyped URLs and pages that are moved or deleted without redirection.1, source 1
A 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.2, source 2 An origin server that wishes to hide the current existence of a forbidden target resource may respond with a 404 (Not Found) status code instead.2, source 2 Except when responding to a HEAD request, the server should send a representation containing an explanation of the error situation, and whether it is a temporary or permanent condition.2, source 2 A 404 response is heuristically cacheable, unless the method definition or explicit cache controls say otherwise.2, source 2
Google's Page indexing report describes a Not found (404) page as one that returned a 404 error when requested.3, source 3
A 404 status code only indicates that the resource is missing, without indicating whether this is temporary or permanent.1, source 1 The HTTP 410 Gone client error response status code indicates that the target resource is unavailable at the origin server and that this condition is likely to be permanent.4, source 4 RFC 9110 says the 410 (Gone) status code is preferred over 404 if the origin server knows that the condition is likely to be permanent.2, source 2 Server owners should use a 404 status code instead of 410 when they do not know whether the condition is temporary or permanent.4, source 4
The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed.2, source 2 Clients should not repeat requests for resources that return a 410 response, and website owners should remove or replace links that return this code.4, source 4
A 410 response is cacheable by default.4, source 4 On Apache, the mod_alias Redirect directive with the gone status returns a Gone (410) status, indicating that the resource has been permanently removed, and the URL argument should be omitted.5, source 5
Links that lead to a 404 page are often called broken or dead links and can be subject to link rot.1, source 1 These 404 errors on a website can lead to a poor experience for visitors, so the number of broken links, internal and external, should be minimized.1, source 1 Google may discover a 404 URL as a link from another page, or because the page existed before and was deleted.3, source 3 In general, Google recommends fixing only 404 errors that you link to yourself or list in a sitemap.3, source 3
Redirect loops happen when additional redirections follow the one that has already been followed, so the loop is never finished and no page is ever found.6, source 6 In the event you meet a 500 Internal Server Error soon after modifying a server configuration, it is likely a redirection loop.6, source 6 A redirect loop is a different problem from a 404.
The default WordPress permalink setting is Plain, which is configured automatically when you install WordPress.7, source 7 Plain permalinks look like http://example.com/?p=N, where p is the parameter and N is the unique ID of the post or page in the database.7, source 7 In a WordPress custom permalink structure, you should end the structure with either %post_id% or %postname% so that WordPress can target an individual post for every permalink.7, source 7 WordPress permalinks are meant to be permanent URLs that should never be changed.7, source 7
In the WordPress dashboard, you choose the permalink structure under Settings, then Permalinks.7, source 7 Your hosting provider should have configured the web servers so that Pretty and Almost Pretty permalinks work, and you need to contact your hosting provider when they do not work.7, source 7
The .htaccess file is a distributed configuration file that Apache uses to handle configuration changes on a per-directory basis.8, source 8 On an Apache server, WordPress modifies the .htaccess file, most notably to handle pretty permalinks.8, source 8 WordPress publishes its .htaccess code, which may be used to restore a corrupted .htaccess file, for example one damaged by a misbehaving plugin.8, source 8 The basic WordPress .htaccess code includes the lines RewriteCond %{REQUEST_FILENAME} !-f, RewriteCond %{REQUEST_FILENAME} !-d and RewriteRule . /index.php [L].8, source 8
WP_DEBUG is a PHP constant that can be used to trigger debug mode throughout WordPress, and it is assumed to be false by default.9, source 9 In WordPress, setting both WP_DEBUG and WP_DEBUG_LOG to true in wp-config.php logs errors to a file called debug.log in the wp-content directory.9, source 9 WordPress does not recommend using WP_DEBUG or the other debug tools on live sites, because they are meant for local testing and staging installs.9, source 9
Apache says its generic error responses for 4xx or 5xx status codes are rather stark and uninformative, so you may want custom error responses that are friendlier or styled to match your site.10, source 10 Apache custom error responses can be defined for any 4xx or 5xx status.10, source 10 When there is a problem or error, Apache httpd can output a simple hardcoded error message, output a customized message, internally redirect to a local URL-path, or redirect to an external URL.11, source 11 On Apache, outputting the simple hardcoded error message is the default, and the other options are configured with the ErrorDocument directive.11, source 11
On Apache, the ErrorDocument directive is written as ErrorDocument followed by a 3-digit code and an action.10, source 10 On an Apache server, you can specify a path to a custom 404 page in a .htaccess file.1, source 1 The Apache ErrorDocument directive may be used in .htaccess files when AllowOverride is set to FileInfo.10, source 10 An Apache .htaccess line that shows notfound.html to visitors on 404 responses reads ErrorDocument 404 /notfound.html.1, source 1
A common approach is to name the custom error file 404.html or 404.php, depending on the server-side technology, at the top level of the server.1, source 1 When an Apache ErrorDocument points to a remote URL, meaning anything with a method such as http in front of it, Apache HTTP Server sends a redirect to the client.11, source 11 With an Apache ErrorDocument that points to a remote URL, the client does not receive the original error status code but a redirect status code, which can confuse web robots and other clients that use the status code to determine whether a URL is valid.11, source 11 Should you use Apache mod_proxy, you may wish to enable ProxyErrorOverride to provide custom error messages on behalf of your origin servers; without it, Apache httpd will not generate custom error documents for proxied content.11, source 11
In nginx, the try_files directive checks the existence of files in the specified order and uses the first found file for request processing.12, source 12 The path to a try_files file is constructed from the file parameter according to the root and alias directives.12, source 12 You can check a directory's existence with try_files by specifying a slash at the end of a name.12, source 12 When none of the try_files files are found, nginx makes an internal redirect to the uri in the last parameter.12, source 12
The last try_files parameter can also be a code, as in try_files $uri $uri/index.html $uri.html =404;.12, source 12 The nginx error_page directive defines the URI that will be shown for the specified errors, as in error_page 404 /404.html;.12, source 12 Another error_page example is error_page 404 =200 /empty.gif;.12, source 12 An nginx error_page directive causes an internal redirect to the specified uri with the client request method changed to GET for all methods other than GET and HEAD.12, source 12
Should error_page uri processing lead to an error, nginx returns the status code of the last occurred error to the client.12, source 12 Furthermore, nginx can use a URL redirect for error processing, as in error_page 404 =301 http://example.com/notfound.html;.12, source 12
Google does not index URLs that return a 4xx status code, and URLs that are already indexed and return a 4xx status code are removed from the index.13, source 13 For Google, all 4xx errors except 429 are treated the same: crawlers tell the next processing system that the content doesn't exist.13, source 13 The 4xx status codes, except 429, have no effect on Google's crawl rate.13, source 13
For Google, freshly encountered 404 pages aren't processed, and the crawling frequency gradually decreases.13, source 13 Google continues to crawl all known URLs for a while even after they return 4XX errors, in case it's a temporary error.3, source 3 There is no way to tell Googlebot to permanently forget a URL.3, source 3 Google says the only case when a URL won't be crawled is when it returns a noindex directive.3, source 3
Google says 404 responses are not necessarily a problem when a page has been removed without any replacement.3, source 3 For Google Search, when a page returns a 2xx (success) status code but its content suggests an error, such as an empty page or an error message, Search Console shows a soft 404 error.13, source 13
Google's Page indexing report describes a soft 404 as a page that returns a visitor-friendly not found message but not a 404 HTTP response code.3, source 3 Google recommends returning a 404 response code for truly not found pages, and adding more information on the page to let it know that the page is not a soft 404.3, source 3
If a page has moved, Google recommends returning a 3XX redirect to the target page.3, source 3 Redirect responses have status codes that start with 3 and a Location header holding the URL to redirect to.6, source 6 Google does not index a redirect URL, only the redirect target.3, source 3 Search engines receiving a 301 response attribute links to the original URL to the redirected resource, passing the SEO ranking to the target URL.14, source 14
Setting up server-side redirects requires access to the server configuration files, for example the .htaccess file on Apache, or setting the redirect headers with server-side scripts such as PHP.15, source 15 The HTTP 301 Moved Permanently redirection status code indicates that the requested resource has been permanently moved to the URL in the Location header.14, source 14 A 308 Permanent Redirect is equivalent to 301, but altering the request method after a 308 response is prohibited.14, source 14
The Apache module mod_rewrite provides a way to do URL manipulations.16, source 16 On Apache, the mod_alias Redirect and RedirectMatch directives set up 302 redirects by default, and an extra parameter such as the permanent keyword or an HTTP status code sets up a different redirect.6, source 6 On Apache, the mod_alias directive Redirect permanent "/old" "https://example.com/new" sets up a permanent redirect.15, source 15 In the Apache Redirect directive, the permanent status returns a permanent redirect status (301) indicating that the resource has moved permanently.5, source 5
In nginx, the return directive can specify a redirect URL for codes 301, 302, 303, 307 and 308.17, source 17 In nginx, you can redirect by creating a specific server block with return 301 $scheme://www.example.com$request_uri;.6, source 6
A 404 error means the server cannot find the requested resource. It can also mean the server is not willing to disclose that the resource exists.
No, it is a client error status code. The 4xx class indicates that the client seems to have erred. Common causes are mistyped URLs and pages that are moved or deleted without redirection.
A 404 does not say whether the resource is missing for good. A 410 Gone code indicates that the target resource is unavailable and that this condition is likely permanent. Servers should use 404 when they do not know whether the condition is temporary or permanent.
No, not necessarily. Google says 404 responses are not necessarily a problem when a page was removed without any replacement. In general, Google recommends fixing only 404 errors that you link to yourself or list in a sitemap.
You can configure custom error documents using the ErrorDocument directive. When AllowOverride is set to FileInfo, you can use it in a .htaccess file to point to your custom 404 page, for example with the line ErrorDocument 404 /notfound.html.
A soft 404 shows a not found message without a 404 code. For truly not found pages, Google recommends returning a real 404 response code instead.
Every fact on this page comes from one of these, checked before it goes live.
Error fixes
A 502 Bad Gateway means a gateway or proxy got an invalid response. Fixing it probably needs the site owner or host, unless your own network is the cause.
· Mateo Cardenas
Email hosting
123 Reg's Web Hosting, Hosting for WordPress and Premium Hosting plans include email addresses, and 123 Reg sells Titan and Microsoft 365 email plans.
· Mateo Cardenas
Email hosting
Web hosting sometimes includes business email. See what SiteGround, Namecheap and HostGator state, then how MX records and SPF records work.
· Mateo Cardenas
Hosting types
How a free website builder works on WordPress.com, whose Free plan includes hosting but shows ads and limits the address, storage, plugins and support.
· Mateo Cardenas