Press "Enter" to skip to content

AllowEncodedSlashes in Apache

对于Apache来说, 如果URL和PATH_INFO中出现%2f(/)或者%5c(\), 会被认为这是个不合法的请求, Apache将会直接返回404结束.

对于使用mod_rewrite做URL改写的情况来说, 可能会比较容易遇到这个问题.

解决的办法有两种.

1. 进行俩次encode, /变为%252f
2. 在apache的配置中增加: AllowEncodedSlashes On

具体可以参看:http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes

2 Comments

  1. clicker heroes
    clicker heroes 2017-12-31

    对于使用mod_rewrite做URL改写的情况来说, 可能会比较容易遇到这个问题.!!

  2. Definitely believe that that you said. Your favorite justification seemed to be at the internet the easiest thing to remember of.
    I say to you, I certainly get annoyed whilst folks think about
    issues that they plainly do not understand about. You controlled to hit the nail upon the top
    and outlined out the entire thing without having side effect ,
    people could take a signal. Will likely be again to get more.
    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *