Need to allow encoded slashes on Apache

后端 未结 7 1968
我寻月下人不归
我寻月下人不归 2020-11-30 20:12

I\'m currently trying to place a URL within a URL. For example:

http://example.com/url/http%3A%2F%2Fwww.url2.com

I\'m aware that I have to

7条回答
  •  有刺的猬
    2020-11-30 20:57

    After a fair bit of testing, and looking at the bug in Apache, I've concluded that despite offered solutions in different forums, this is an unresolved issue in Apache. See the bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=35256

    The workaround that works for me is to refactor the URI so that the item that can contain the escaped slashes is in the query section of the URI, instead of the path. My tests show that when they are there, they don't get filtered out by Apache, no matter the AllowEncodedSlashes and AcceptPathInfo settings.

    So: http://test.com/url?http%3A%2F%2Fwww.url2.com

    or: http://test.com/url?theURL=http%3A%2F%2Fwww.url2.com

    instead of: http://test.com/url/http%3A%2F%2Fwww.url2.com

    This means an architecture change for our project, but it seems unavoidable. Hope you found a solution.

提交回复
热议问题