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



  1. smash karts
    smash karts June 11, 2021

    這絕對是一篇包含我正在尋找的有價值信息的文章。 因此,我非常感謝您為撰寫此信息所做的努力。

  2. clicker heroes
    clicker heroes December 31, 2017

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

  3. 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

Comments are closed.