[5.0] Fixed Routes With Fragments In The URL

The previous implementation would put the query after the fragment, which is incorrect. It should be the query followed by the fragment.