姜戈 + Apache 通过 FastCGI:http 错误代码被删除
我通过 FastCGI 使用 Django + Apache,在错误处理程序中包含以下代码:
def handler404(request):
response = render_to_response('errors/404.html', locals(), context_instance=RequestContext(request))
response.status_code = 404
return response
我获取无效的 URL,请参阅我的自定义 404 页面,但 apache 访问日志中有类似的内容:
- - [29/May/2011:15:10:29 -0700] "GET /qqq HTTP/1.1" 200 1316 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17"
Is it possible to have 404 code in Apache to Tell,搜索引擎爬虫,例如,该页面不可用? 谢谢!
I am using Django + Apache via FastCGI, having this code in error handler:
def handler404(request):
response = render_to_response('errors/404.html', locals(), context_instance=RequestContext(request))
response.status_code = 404
return response
I fetch invalid URL, see my custom 404 page, but there is something like this in apache access log:
- - [29/May/2011:15:10:29 -0700] "GET /qqq HTTP/1.1" 200 1316 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110420 Firefox/3.6.17"
Is it possible to have 404 code in Apache to tell, search engine crawlers, for example, that this page is not available?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论