Tech Tip: Why custom HTTP error pages may not be working
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: July 9, 2025
Custom HTTP error pages are useful for displaying web errors that have a particular look and message to fit the developer’s preferences and the web users’ needs. Sometimes these custom pages are not served when users encounter a web error, even though the files have the correct naming and are in the right location (in the root level of web folder). This could happen because there may be logic in the On Web Connection method that is overriding the default functionality. Check the On Web Connection method to see if, for example, there are any “Else” statements, like in the following:
Case of // ... do stuff with specific URL targets ... Else WEB SEND TEXT("Something went wrong! Check back later.") End case |
In the above example, when the URL target does not match any cases, the “Else” statement triggers and sends a message to the web user. This takes priority over any custom error pages installed in the web folder. Remove the “Else” statement to have custom error pages served instead.