URL hash is persisting between redirects

I suggest that this is the correct behaviour. The 302 and 307 status codes indicate that the resource is to be found elsewhere. #bookmark is a location within the resource.

Once the resource (html document) has been located it is for the browser to locate the #bookmark within the document.

The analogy is this: You want to look something up in a book in chapter 57, so you go to the library to get the book. But there is a note on the shelf saying the book has moved, it is now in the other building. So you go to the new location. You still want chapter 57 – it is irrelevant where you got the book.

Leave a Comment