开发者

Django + Apache via FastCGI: http error code is erased

开发者 https://www.devze.com 2023-03-08 22:43 出处:网络
I am using Django + Apache via Fas开发者_C百科tCGI, having this code in error handler: def handler404(request):

I am using Django + Apache via Fas开发者_C百科tCGI, 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消