Fast_404 generates warnings on every instance D9.5.9 - php 8.1

Created on 8 May 2023, about 2 years ago

Problem/Motivation

Every time a 404 is generated from site traffic the 404 event is logged. But system also triggers at least two warning errors in the system log. For sites with a lot of traffic the 404 event log is indated with 3 instead of 1 record per 404 event.

Core: 9.5.9
PHP: 8.1
Apache: 2.4.52
MariaDB: 10.6.12

Steps to reproduce

Enter an invalid url on the site.

Proposed resolution

Clean up the 404 regular expressions and or add filters to clean it up.

/core/modules/system/config/install/system.performance.yml
LIne: 7

fast_404:
  enabled: true
  paths: '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i'
  exclude_paths: '/\/(?:styles|imagecache)\//'

Remove the "(" and ")" in the regular expressions to look like.

fast_404:
  enabled: true
  paths: '/\.?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp$/i'
  exclude_paths: '/\/?:styles|imagecache\//'

Alternatively, and of course a messier alternative is to add filters to the code that calls the settings.

(patch attached)

Release notes snippet

If reformatting the install YAML consider a update hook to reset the default settings.

πŸ› Bug report
Status

Active

Version

9.5

Component
BaseΒ  β†’

Last updated about 19 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States emptyvoid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024