I have this code:
It redirects to /mypage, but it doesn not include the #actions_clicker part. How do I make Drupal not loose the hash / # part?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
Try url encoding the
# fragment. so it becomes
Check the browser header to see that the fragment is passed. In my local testing it was ok:
Sample code to append fragment to redirect response.
return new RedirectResponse($redirect_url . '#test', 301);
More info: https://stackoverflow.com/a/2305927/583715