url redirections not working for anonymous users
This is probably because of the page cache for anonymous users. The cache is implemented as middleware and runs before any event subscriber, even if you set a  high priority.

If your site serves dynamically generated responses and redirects for every single request, then you don't need this cache and you can uninstall the module Internal Page Cache.

If you want to disable the page cache in code:

\Drupal::service('page_cache_kill_switch')-&gt;trigger();


This will deny any page caching on the current request.