我允许用户在 mysite.com/go/QUERY 提交查询\
如果查询包含“/”,Apache 就会被阻塞。
来自 urls.py:
(r'^go/(?P<querytext>.*)$', 'mysite.engine.views.go'),
尝试:
http://mysite.com/go/http%3A%2F%2F
结果:
Not Found
The requested URL /go/http:// was not found on this server.
Apache/2.2.12 (Ubuntu) Server at ...
但是,如果我输入非 URL 引用值,它会起作用:
http://mysite.com/go/http://
工作得很好...
有什么想法吗?
最佳答案
您的 httpd 正在阻止编码的斜杠。
尝试将 AllowEncodedSlashes On
添加到您的 apache 配置中 enable encoded slashes in apache (docs)
关于django - Apache Django URL 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2242198/