New answers tagged

0

I have searched all over, and pretty much in all cases, no one understands the problem. I don't have the answer, but can only provide more clarity for the problem, and a suggestion for the best place for a solution ... THE PROBLEM BLOCK access for anonymous users using /node/{nid} in the PATH Still render the page for anonymous users USING THE ALIAS for ...


4

This solution is based on a suggestion by @4k4 at Redirect from within controller always goes to home page. My custom module is named rsc. In modules/custom/rsc the file rsc.services.yml includes the following: services: rsc.event.Redirect404: class: Drupal\rsc\EventSubscriber\rscRedirect404 tags: - {name: event_subscriber} In modules/...


1

Alright got it working! The redirect module hooks into the kernel.request event and will redirect if you're doing wildcard routing like I am below. You may want to split this up into two services since we're hooking into two events, but they're directly related so I chose to keep it simple. Basic explanation of methods in here is: PathSubscriber::...


Top 50 recent answers are included