为了提高网页的用户体验, 我们经常会做一些对搜索引擎不太友好的事情, 但某些情况下这并不是无法挽回的, 可以通过向自然人和搜索引擎机器人显示不同的内容来提供好的用户体验和 SEO.
听说本方法会触犯搜索引擎的一些操作原则, 有可能被被各搜索引擎处罚, 甚至删除网站. 所以我刚刚已经撤下这样的处理, 直到确定其不属于作弊. 有魄力的朋友可以继续使用, 但后果自负.
本博客的首页和存档页面以列表的形式显示文章, 在访客点击展开文章时才加载文章的内容. 因为文章的内容部分包含了大量的文字和图片, 需要大量的加载时间和流量. 尽快地向访客展示网页可以挽留大量的来访者. 而对于手机用户来说, 加载时间和流量则更为重要.
一般来说, 网站的首页是搜索引擎访问最多的页面, 应该尽可能的向它们展示有意义的内容, 但是要以列表的形式显示文章的话, 访客和搜索引擎只能获取到文章标题信息. 文章内容或者摘要 (尤其是文章的第一句) 对于 SEO 来说是极其重要的, 所以我们要设法向爬虫发送这些内容.
好, 我们可以通过 User Agent 来判断访问者是否为爬虫, 如果是, 则以一般形式显示文章, 否则以列表形式显示文章列表. 可以用以下的 PHP 方法判断是否为爬虫:
$userAgent = strtolower($_SERVER[‘HTTP_USER_AGENT’]);
$spiders = array(
‘Googlebot’, // Google 爬虫
‘Baiduspider’, // 百度爬虫
‘Yahoo! Slurp’, // 雅虎爬虫
‘YodaoBot’, // 有道爬虫
‘msnbot’ // Bing爬虫
// 更多爬虫关键字
);
foreach ($spiders as $spider) {
$spider = strtolower($spider);
if (strpos($userAgent, $spider) !== false) {
return true;
}
}
return false;
}
这是我使用的方法, 各爬虫以访问评论由高到低进行排序. 然后通过下面的的方法向爬虫和自然人显示不同的内容
波比源码 » PHP实现向访客和爬虫显示不同的内容
cheap levofloxacin 500mg purchase levofloxacin online cheap
avodart over the counter buy tamsulosin 0.4mg online order ondansetron pill
cialis 10mg sans ordonnance en france sildenafil 50mg sans ordonnance en pharmacie acheter 100mg sildenafil
buy tacrolimus 1mg pill ropinirole tablet buy ursodiol 150mg
buy isosorbide 40mg online telmisartan price buy telmisartan 80mg online
order bupropion online cetirizine price quetiapine 50mg drug
order salbutamol generic purchasing viagra on the internet generic sildenafil
order cialis 10mg generic order pyridium 200 mg online cheap buy amantadine 100mg
medroxyprogesterone drug cost praziquantel order periactin 4 mg online
provigil cost online canadian pharmacy legit ivermectin side effects
amlodipine 10mg pill buy viagra 50mg pills cialis 20mg ca
viagra professional lisinopril 5mg oral order lisinopril 2.5mg online
omeprazole sale buy omeprazole 20mg for sale world poker online
order imitrex 50mg pills order imitrex 25mg pills avodart 0.5mg pills
buy keflex 250mg generic cleocin 300mg pill purchase erythromycin pills
order tadalafil 40mg for sale tadalafil 20mg for sale viagra 50mg price
zithromax over the counter prednisolone 10mg brand neurontin without prescription
buy tretinoin cream sale order avanafil 200mg online cheap purchase avanafil generic
lamisil 250mg generic cefixime for sale online order amoxicillin
naprosyn 500mg drug order generic cefdinir 300 mg lansoprazole order
buy biaxin 500mg generic catapres 0.1 mg without prescription buy antivert online
oral proventil pantoprazole for sale online order ciprofloxacin 1000mg online
buy singulair 5mg pill singulair 5mg generic viagra 100mg england
order generic cialis gambling casino online best online blackjack real money
internet roulette online casino games for real money blackjack card game
oral stromectol cost dapsone 100 mg generic order dapsone 100mg online cheap
free slot machine games online casinos online casino with free signup bonus real money usa
buy nifedipine order aceon 8mg for sale cost fexofenadine 120mg
buy altace online cheap buy altace generic order generic arcoxia
purchase doxycycline pills doxycycline 100mg over the counter order cleocin 150mg sale
buy mesalamine 800mg pill astelin 10 ml cost avapro 300mg ca
order clobetasol for sale buy buspar 5mg online amiodarone 200mg drug
amoxil order online amoxil 250mg generic buy ivermectin 12 mg online
order priligy 60mg order motilium sale motilium ca
Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me. Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
tricor 200mg without prescription sildenafil tablets viagra for men
generic cialis cost purchasing viagra on the internet cheap viagra online
minocin tablet buy minocycline capsules terazosin cost
buy fildena 50mg pills buy pregabalin 75mg pills purchase proscar for sale
order prednisolone 20mg order gabapentin online furosemide online order
dutasteride pills oral xenical 120mg order xenical generic
doxycycline 200mg drug levitra 10mg oral zovirax generic
oxybutynin 2.5mg oral trileptal online buy trileptal 600mg us
omnicef 300mg generic prevacid oral pantoprazole uk
buy avlosulfon generic atenolol tablet buy generic atenolol online
levaquin 250mg pill levaquin 250mg brand buy zyban without prescription
cetirizine 10mg canada buy zoloft 100mg purchase sertraline online
buy cenforce generic chloroquine over the counter metformin 1000mg usa
purchase escitalopram generic brand fluoxetine 20mg naltrexone drug
order letrozole purchase viagra pills brand sildenafil 100mg
cialis 20mg cheap cheap cialis 10mg buy generic ed pills for sale
neurontin buy online buy generic furosemide over the counter buy monodox sale
order ventolin inhalator for sale buy synthroid generic levothyroxine over the counter
albendazole tablet buy generic albendazole provera over the counter
buy praziquantel 600mg for sale buy praziquantel online cheap generic periactin 4 mg
order lyrica 75mg generic claritin sale dapoxetine 60mg over the counter
cost xenical 120mg acyclovir online order buy allopurinol 300mg sale
buy losartan 25mg pills cheap nexium 40mg buy topiramate without prescription
buy zantac 150mg generic buy ranitidine 300mg without prescription order celecoxib 100mg pill
buy plavix 75mg online cheap order clopidogrel 150mg online nizoral 200 mg pill
order duloxetine pills glucotrol generic piracetam price
buy cheap prometrium purchase progesterone pills olanzapine price
oral zocor 20mg purchase valacyclovir sildenafil 50mg usa
fluconazole tablet order ciprofloxacin 1000mg sale buy ciprofloxacin sale
buy metronidazole pills for sale metronidazole 400mg us buy cephalexin 125mg generic
nolvadex us order generic nolvadex 20mg cefuroxime tablet
ivermectin ireland order stromectol 3mg pills buy deltasone 10mg generic
coreg for sale online cenforce 100mg tablet buy chloroquine online
order lanoxin sale order micardis without prescription order molnupiravir 200 mg generic
order naprosyn for sale cefdinir 300 mg ca buy prevacid generic
proventil brand buy generic phenazopyridine order generic phenazopyridine
buy priligy 60mg without prescription order generic priligy 90mg xenical 60mg pill
rosuvastatin price buy crestor domperidone price
plavix 150mg generic order methotrexate generic medex us
budesonide allergy spray buy generic careprost for sale careprost order
reglan sale purchase losartan for sale esomeprazole brand
purchase retin online order tretinoin cream generic order avanafil 200mg without prescription
buy proscar 5mg pills oral propecia buy viagra
tadalafil 40mg canada buy cialis 20mg online cheap viagra overnight shipping
purchase lamisil generic order amoxicillin 250mg pill purchase trimox generic
generic azulfidine 500 mg calan 240mg sale verapamil 240mg us
order molnunat online order naprosyn buy cheap omnicef
sexual dysfunction cheap cialis sale tadalafil 20mg drug
buy prevacid 30mg generic lansoprazole over the counter order pantoprazole 20mg generic
buy fexofenadine cheap glimepiride 1mg for sale amaryl 4mg without prescription
etoricoxib pills order etoricoxib 60mg generic buy astelin 10 ml sprayer
albenza pill provera buy online buy provera 10mg generic
biltricide 600mg uk brand microzide cyproheptadine online
order glipizide generic buy glipizide 10mg online betnovate creams
order anafranil 50mg without prescription cheap prometrium 100mg order progesterone 200mg pill
buy dexamethasone 0,5 mg generic dexamethasone 0,5 mg cost starlix ca
capoten brand capoten 25 mg canada buy carbamazepine tablets
seroquel 50mg tablet purchase seroquel generic order escitalopram 10mg sale
order ciprofloxacin 500mg pills lincomycin 500mg ca where to buy duricef without a prescription
sarafem 40mg without prescription femara 2.5mg without prescription order femara 2.5 mg online cheap
order combivir for sale buy lamivudine online cheap order accupril 10 mg generic
buy frumil 5 mg without prescription frumil 5 mg uk acyclovir ca
valcivir 1000mg pills order famvir buy floxin 400mg