Add a way of seeing the referrer for each 404

Created on 21 July 2023, over 1 year ago
Updated 10 August 2024, 3 months ago

Problem/Motivation

Right now there's no way of seeing the source of a given 404. This is something that's available with a dblog report of 404's, but there's no way of seeing them when using Redirect 404.

Proposed resolution

Provide a way of seeing the referrers for each 404.

Remaining tasks

See #9:

* There is no cleanup process for thew new table, which is a big challenge because we don't delete them one by one, so this table could get very, very large. Might need it's own handling
* Table name is not using module prefix
* Update hook shouldn't call hook_schema() because that might change in the future
* Should probably use a merge query like the main table to avoid many duplicate rows and instead use a counter.
* Should have an answer for displaying this information by default in a useful way if we bother to store it.

User interface changes

A means would exist to see the referrer, the source of each 404.

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Needs work

Version

1.0

Component

User interface

Created by

🇺🇸United States DamienMcKenna NH, USA

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

Merge Requests

Comments & Activities

  • Issue created by @DamienMcKenna
  • 🇺🇸United States DamienMcKenna NH, USA
  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @DamienMcKenna I totally agree.

    Surely this would have to be tracked in another table and as additional information, but knowing the referrer is extremely helpful to find out and fix the 404's. That way we can wee, where the wrong link is coming from.

    It's a 1:n relation, so it definitely needs another table. I guess the current 404's list can be kept and a link to details should be added, when clicking an entry. That one should then list the referrers.

    Clearing the 404's should also clear that additional table.

    Might be a nice feature to implement for Novice's?

  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 178s
    #204535
  • 🇮🇳India sandipta

    After applying the MR we need to use the drush updb command once.
    The referrers will be stored in the 404_referrers table.
    Too see the referrers from UI itself
    1. Visit /admin/structure/views/add
    2. Under View Settings select 404 Referrers
    3. Add necessary fields to view the referrer

  • Status changed to Needs review 5 months ago
  • Status changed to RTBC 4 months ago
  • 🇵🇭Philippines roberttabigue

    Hi @sandipta,

    I installed and enabled the Redirect module against 8.x-1.x-dev on my D10 site including the Redirect 404, and confirmed the 404 Referrers view is now available and working after applying MR!101.

    Please see the attached files for reference.

    I'm moving this now to ‘RTBC’.

    Thank you!

  • Status changed to Needs work 4 months ago
  • 🇨🇭Switzerland berdir Switzerland

    * There is no cleanup process for thew new table, which is a big challenge because we don't delete them one by one, so this table could get very, very large. Might need it's own handling
    * Table name is not using module prefix
    * Update hook shouldn't call hook_schema() because that might change in the future
    * Should probably use a merge query like the main table to avoid many duplicate rows and instead use a counter.
    * Should have an answer for displaying this information by default in a useful way if we bother to store it.

    This is very much not a novice issue. I'm also not sure that this is necessary. It adds a quite a bit of complexity, doubles storage requirements and suppressing of 404 logs in dblog is optional. If we want to see referers in our projects, we typically disable the suppression at least temporarily.

  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks for the feedback @Berdir!

    Like @DamienMcKenna I think this would be a really useful feature, giving huge benefit to the 404 logging. But you're right, it adds some complexity and isn't essential to the module.
    So I'd say it's a great candidate for a submodule? Would you be fine with that?

    Who needs it, can enable it. I added your points from #9 to the issue summary.

  • 🇨🇭Switzerland berdir Switzerland

    Maybe, but a separate submodule has its own complexity. We'd still need to make the main module extensible and flexible enough so that the submodule could hook into it, and if it's in the same project, it's still complexity that needs to be maintained.

Production build 0.71.5 2024