Retain anchor when redirecting subdomain (IE)

帅比萌擦擦* 提交于 2019-12-04 15:33:00

Had a similar problem in Tomcat/JSP, don't know about PHP. In Tomcat the rule was that the #anchor is only intended for the browser/user agent so you can't get it. My workaround was to use Javascript in the page instead to achieve the redirect. My tip would be that if you can't get it working in PHP soon then start trying a Javascript workaround.

Anchors are never sent to the server, so no server-side solution can retain them.

Only server side anchors can be used durring a server side redirect. They must have an ID (although I am not sure if they have to be created programatically)

Alternately you can pass a parameter and use the onload to move the focus to the ID or hyperlink.

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