How to include fragment (#) in the URL computed by redirect?
The fragment is stored in the options of the url, also the cid in the parameters. So you'll find all information you need in the url permalink() returns:

  $url = $comment-&gt;permalink();

  $this-&gt;redirect($url-&gt;getRouteName(), $url-&gt;getRouteParameters(), $url-&gt;getOptions());