我对URL编码和浏览器有一个奇怪的问题。我有以下网址:
http://abcd.com/?isPosm=1&callBackUrl=http%3A%2F%2FmyAnotherDomian%2FPOSM%2Fapp%2Fpages%2Fadf.task-flow%3Fadf.tfDoc%3D%252FWEB-INF%252Ftask-flows%252Fcatalog-edit-task-flow.xml%26adf.tfId%3Dcatalog%26_adf.ctrl-state%3Dtry2tadtl_32%26articleReference%3D10C00135%26previousView%3Dcatalog-home%26fromUCM%3Dtrue%26articleType%3Dposm%26developer%3Dcentral
在我的机器中粘贴并转到此URL时,它将更改为:
http://abcd.com/index.htm?isPosm=1&callBackUrl=http%253A%252F%252FmyAnotherDomain%252FPOSM%252Fapp%252Fpages%252Fadf.task-flow%253Fadf.tfDoc%253D%25252FWEB-INF%25252Ftask-flows%25252Fcatalog-edit-task-flow.xml%2526adf.tfId%253Dcatalog%2526_adf.ctrl-state%253D14a6xfftpt_9%2526articleReference%253D10C00135%2526previousView%253Dcatalog-home%2526fromUCM%253Dtrue%2526articleType%253Dposm%2526developer%253Dcentral
显然,http%3A%2F%2Fuat-pppstore.moet-hennessy.biz
已编码为http%253A%252F%252Fuat-pppstore.moet-hennessy.biz
。为什么会这样?我在Firefox和Chrome中都发现了这一点。奇怪的是,在其他机器上运行的另一个Firefox中它的行为并不相同。
任何指针都非常有用。
答案 0 :(得分:2)
根据您的示例,您的第一个请求是根目录,它已更改为“index.htm”。浏览器永远不会放置此URL(它不知道它是否存在),这表明错误在您的服务器中,将用户重定向到“index.htm”页面并重新编码已编码的URL。