0
我已經設置了一個Django網站,並收到GoogleBot提供的這個提醒,我認爲它將放入我的網址的測試參數(零)。零是在我的數據庫不存在的主鍵Django googlebot抓取AJAX網址
<WSGIRequest
path:/for_sale_detail/0/,
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{},
META:{u'CSRF_COOKIE': u'xxxxxxxxxxxxxxxxx',
'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
'HTTP_CONNECTION': 'close',
'HTTP_FROM': 'googlebot(at)googlebot.com',
'HTTP_HOST': 'example.com',
'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
這是我與所述第一組的數字url.py是我的主鍵(例如下面是2號):
url(r'^for_sale_detail/(?P<slug>[-\w\d]+)/$', for_sale_detail, name='for_sale_detail'),
和在我的HTML文件,AJAX URL(用戶交互後的動態內容填充)被稱爲這樣的方式:
var slug = '2-terrace-link-house';
for (abc < 10)
{
...
slug = new_url;
call_detail_page();
}
function call_detail_page()
{
var detail_page_url = "{% url 'for_sale_detail' '2-terrace-link-house' %}".replace ('2-terrace-link-house', slug);
$.colorbox({
iframe : true,
width : '1200px',
height : '600px',
href:detail_page_url
});
}
我創建的sitemap.xml文件指向所有有效蛞蝓地址,但仍時Googlebot抓取,它會追加「0」到我的URL段落。理想情況下,我會希望被谷歌這樣索引的所有詳細信息頁面,發現不希望Googlebot會重定向到一個不存在的頁面
有效的URL是這樣的:
http://www.example.com/for_sale_detail/2-terrace-link-house
謝謝
這就是我最初不想做的事情,因爲我希望GoogleBot使用站點地圖抓取此頁面,但也許可以實現這一點,因爲GoogleBot不會生成任何隨機url slug – 2014-11-21 06:53:52