Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are use cases where we want to look for content and redirect there if path is not known for Drupal. This can be easily configurable by Rules, if there will be event "404 not found happened".
There are ways how to hack it (Drupal init event and regexp match, Node init and check if node is 404 page, …), but all has performance issues of are otherwise bad.
Comments
Comment #2
TR CreditAttribution: TR commentedHow about instead a Condition to compare the page HTTP status code?
That way this feature could detect ANY status code and allow an appropriate action. This would also address #1001862: Is it possible to redirect to [site:url] on 403/404? (which I'm marking as a duplicate now).
Comment #3
Honza Pobořil CreditAttribution: Honza Pobořil as a volunteer commentedYes, this will work, but probably will not perform like dedicated event, because rule will be executed on all requests.
Comment #4
TR CreditAttribution: TR commentedWe're not looking to add a lot of new features to D7 Rules anymore - new features should go into the current D8 version of Rules then should be backported IF there is sufficient demand from the community.
Because of that, I'm moving this to Rules 8.x-3.x. But this is not something the maintainers are currently intending to work on, so I'm also marking it as postponed.
If you would like to contribute an implementation of this feature please mark this issue "active" and assign it to yourself.
Comment #5
TR CreditAttribution: TR commentedComment #6
TR CreditAttribution: TR commentedHey, if no one wants this and no one is willing to contribute, and if I don't personally find this useful, then there's no way this is going to be added to core Rules. If you want to have this feature then either:
1) contribute a patch here in the the Rules issue queue, or
2) implement this feature in a contribute module, and post here in the issue queue letting us know about your contributed module.