Skip to content

Troubleshooting

Christian Futterlieb edited this page Nov 3, 2020 · 4 revisions

Troubleshooting

Something went wrong (-> start here <-)

First of all: ensure you have the latest version of pagenotfoundhandling installed.

Next, go to Extension Manager configuration and enable the option advanced.debugGetUrlError. Then go through the following list step-by-step:

  1. Call an inexistent page to trigger the 404 case. If you do not see any debug output, there is no 404 page configured (default404Page) => configure a default404Page.
  2. If still no debug output is shown, make sure to add your server's IP to $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'].
  3. In the debug output, checkout the $report array, there might be a message or some other hint to the problem's source => resolve described errors.
  4. From the debug output, copy the value of $url, this will be something like https://example.org/index.php?id={default404Page}&loopPrevention=1. Try to call this URL with a Browser. Important: you MUST NOT be logged in as backend user for this! If the 404 page is not displayed as expected, make the 404 page accessible to the public.
  5. Proceed to 403/404 page cannot be fetched below.

403/404 page cannot be fetched

If the 404 page cannot be fetched for some reason, the basic.defaultTemplateFile (or basic.default403TemplateFile) will be shown as a fallback. This behaviour points to a problem with fetching the 403/404 page.

Log into the server with ssh and test $url (from debug output, use advanced.debugGetUrlError to enable it) with wget, curl or any other tool that can make HTTP requests. If you do not receive the expected response, check the error message(s) you might get and resolve the described problem.

Common problems

1. Domain name cannot be resolved

Make the DNS for the domain available to the server or add the domain to the server's /etc/hosts file.

2. Self-signed SSL certificate (mostly in dev or staging environments)

Either make the server (NOT your browser!) trust your certificate or simply setup/test the 403/404 page without SSL/TLS. As a last resort, the verification of certificates could be disabled (for the requesting library), which is strongly discouraged because this is a security problem! It is too easy to forget such a configuration and stage it to a productive server.

3. The access to the website is protected (with mod_auth_* from apache for example)

Check whether there is any authentication/authorization rule that excludes the webserver machine (such as Require [not] ip xyz or Allow from xyz or Deny from xyz etc) and either remove them or change them to allow requests from the webserver itself too.

Note: pagenotfoundhandling is able to detect the Authorization HTTP header and re-uses it for fetching the 403/404 page. Which means that a simple password-only authentication will "just work". In some FastCGI/FPM setups though, PHP does not receive the Authorization header from apache. In this case, you can add the following to your .htaccess file (see https://www.php.net/manual/en/features.http-auth.php#114877):

<IfModule mod_setenvif.c>
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>

Note 2: If you use digest authentication, credentials can be configured in http.digestAuthentication in Extension Manager configuration. But: better use basic authentication in combination with https because digest authentication has numerous security problems.