Redirecting does not remove anchor from the URL |
If an anchor is in the old page, it is still presented after redirecting to the new page, where it does not make sense. An anchor should not be there until it is explicitly added in the redirection rule.
For example return redirect()->to('to'); redirecting http://localhost:8080/from#old-anchor to http://localhost:8080/to#old-anchor, which it should not. The return redirect()->to('to#new-anchor'); redirecting http://localhost:8080/from to http://localhost:8080/to#new-anchor, which is how it should be. It is also replacing an old anchor to a new anchor, which is also expected: return redirect()->to('to#new-anchor'); redirecting http://localhost:8080/from#old-anchor to http://localhost:8080/to#new-anchor. So the only problem is in the first case, when old URL have an anchor, but the new URL does not. The same with the redirectResponse. return redirect()->route('to'); and return redirect('to'); does not support anchors in the redirection rule, but the bug from the first example is presented. I tested it on a fresh CodeIgniter's 4.3.3 installation on PHP 8.1.12 on my Linux machine. |
Messages In This Thread |
Redirecting does not remove anchor from the URL - by Muzikant - 04-19-2023, 03:31 AM
RE: Redirecting does not remove anchor from the URL - by kenjis - 04-19-2023, 04:37 AM
RE: Redirecting does not remove anchor from the URL - by Muzikant - 04-20-2023, 01:04 AM
RE: Redirecting does not remove anchor from the URL - by kenjis - 04-21-2023, 05:12 AM
RE: Redirecting does not remove anchor from the URL - by Muzikant - 04-23-2023, 08:09 AM
RE: Redirecting does not remove anchor from the URL - by kenjis - 04-23-2023, 05:32 PM
RE: Redirecting does not remove anchor from the URL - by Muzikant - 04-24-2023, 07:59 AM
RE: Redirecting does not remove anchor from the URL - by kenjis - 04-23-2023, 05:30 PM
RE: Redirecting does not remove anchor from the URL - by kenjis - 04-24-2023, 04:49 PM
RE: Redirecting does not remove anchor from the URL - by ping-yee - 04-25-2023, 02:24 AM
|