1

It seems that after a 302 direct, the browser preserves the fragment identifier:

/foo#/bar/baz

returns 302 to /login, but browser shows:

/login#/bar/baz

How do I get the browser to redirect and clear the fragment so it just shows:

/login
unor
  • 92,415
  • 26
  • 211
  • 360
aaa90210
  • 11,295
  • 13
  • 51
  • 88
  • This would have been a duplicate (but it’s closed as duplicate itself): [301 Redirect without fragment](https://stackoverflow.com/q/14477154/1591669) – unor Mar 12 '19 at 19:13

1 Answers1

1

It seems that if the server adds '#' to the end of the redirect URL it will override any existing fragment. Of course, the redirect URL must tolerate an empty fragment, but if so, the redirect header can simply be:

Location /login#

Works for me.

aaa90210
  • 11,295
  • 13
  • 51
  • 88