django - Apache Django URL 问题

标签 django apache url

我允许用户在 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/

相关文章:

css无法加载其他目录中的图像

javascript - 如何从嵌套对象生成查询字符串

flash - 如何从 Flash AS3 中的 URL 获取/获取变量

python - 有没有办法在单个查询中获取表行和表数据的总数

python - django manytomany - 从中​​获取值(value)

django - 尝试在 Docker 上使用 NGINX + Gunicorn 时,NGINX 给出 502 Bad Gateway

css - Django 模板 : Group items in Threes

java - 如何在java中从Apache-commons scxml api读取数据模型值

php - 在 apache 中限制从 Internet 访问

vb.net - VB.NET从youtube网址获取V变量