Hyperlinks stop working in firefox after redirect?

那年仲夏 提交于 2019-12-11 07:48:07

问题


On a project I'm working on, I am using HTTP headers to redirect the user to the frontpage after a successful login;

header("Location: http://example.com/index.php?");
exit(0);

EDIT: Added questionmark to url to show the problem

This works fine in all browsers tested - however, in Firefox 3.0.6, both on windows, mac and debian, it fails to set the hyperlinks properly. Every single hyperlink points to the same URL the redirect points to, completely ignoring the "href" attribute. Refreshing the page does not help - I have to re-enter the URL manually and hit enter for the hyperlinks to start working again.

I've tried this in IE6, IE7, Opera and Safari, and it works fine. I'm assuming something is wrong with the way I implement the redirect, could anyone point me in the right direction?


回答1:


The solution seems to be this: I cannot redirect to a url ending with a questionmark, if I do, this problem will occur. It would seem to me this is not expected behavior from FF3, but I don't know the HTTP-spec's well enough to say if that's the case.

Either way, problem solved by removing question-mark from redirect url.



来源:https://stackoverflow.com/questions/526114/hyperlinks-stop-working-in-firefox-after-redirect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!