Home Random Call article database specified number of URL tags to improve the rate of collection

Source: Internet
Author: User
Keywords Website optimization SEO

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

At hand a website content page of more than 100,000, because has been in Baidu and Google and other major search engines on the rate is not good, so today suddenly sprouted an idea, can write a random call on the homepage of the article database specified number of URL tags to increase the display rate to the search engine, So every time the search engine spiders in the index, can see different pages, can increase the likelihood of crawling, and then improve the rate of inclusion.

One, let the page display randomly arrange the article title list Method 1 (for SQL database)

Because of the use of the Dynamic Web site management system, so consulted the rain zhe, found that the idea is feasible, there are other people have written the corresponding label, but the efficiency is relatively low, rain Zhe gave a simple solution:

First, add the dynamic tag directly in the background, and the query statement is: Select top articleid,title from pe_article where Deleted = {$PE _false} and Status =3 order by NEWID ( DESC, if you want to randomly invoke 200 articles, change top 100 directly to top 200.

Second, set the label content (that is, add a dynamic label to the second step of the loop content) is: {loop}{infobegin}{$Field (0,geturl,article,3)}

{Infoend} {/loop}.

Finally, note that, because the dynamic label has a cache, the generation must first update the next site cache.

After the solitary heroes of the field test, the above scheme is fully passed, the effect is perfect:).

Because the custom label has only SQL to use random tags, the above scenario is only suitable for dynamic SQL versions. The main idea is to use the NEWID () in the query statement, the sort on the random to achieve.

Two, let the page display randomly arrange the article title list Method 2 (suitable for SQL database)

Netizen Small Code Brother provides another one to let the page display randomly arrange the article title list method, lets the website page display the article title list to be able to refresh with the page, simultaneously also has the change. This program can be detailed to a section of a channel random article:

The steps are simple:

1, add Tags: {$MY _ produce a random article in this month's column}. The label name here can be customized.

2. The query statement is written as: Select Top articleid,classid,title,updatetime from pe_article where Channelid ={input (0)} and DateDiff (Day, Updatetime,getdate ()) <30 and Deleted=0 and status=3 order by NEWID ()

3, the label content is written as:

{Loop} {Infobegin}

{$Field (2,text,22,2,1)}

{Infoend} {/loop}

4. Template call

Where the page needs to be written {$MY _ produces a random article in this month (1002)}, 1002 of which corresponds to our dynamic channel ID, can be changed according to their own actual. In the query statement DateDiff (Day,updatetime,getdate ()) <30 in the "30" is the query one months of the article, this value can be adjusted according to the actual situation of the site.

Three, let the page display randomly arrange the article title list Method 3 (for Access database)

It is necessary to note that the above solitary heroes and friends of the two solutions are given only can be applied to the SQL database, not suitable for the AC database. If you are using the easy access version of the random article list, you can see the technical solution provided by the Netizen Arko:

First of all, it should be noted that at this time in the background custom label management is a new function tag, tag name can be named {$MY _ random article}.

The query statement is set to: ("Top10" in 10 is to query the number of articles, you can change their own, but not recommended to change too much; If you do not want to call the column, but call a channel under the article, then you can put Channelid in ({input (0)}) and ClassID in ( {input (1)}) Modified to: Channelid in ({input (0)}), the corresponding call tag is: {$MY _ random article (channel ID)}; " DateDiff ("D", date (), updatetime) <7 "7 refers to the query of the last 7 days of the article, as needed to modify;"

Select Top Articleid,classid,title,updatetime from Pe_article where Channelid to ({input (0)}) and ClassID in ({input (1)} ) and DateDiff ("D", date (), updatetime) <7 and deleted={$PE _false} and Status=3 order by right (CStr (Rnd Rnd (-timer ()) *100)) *1000*now (), 2);

The label content is set to:

{Loop} {Infobegin}

{$Field (2,text,44,2,1)}

{Infoend} {/loop}

Secondly, in the appropriate position in the template to add {$MY _ random article (channel ID, column ID) can be invoked, where the channel ID, column ID can be modified according to their actual.

It should be noted that good results in the loss of performance in the premise of implementation, no more than the dynamic label of SQL database, this tag code efficiency is very low, although the label to ensure the randomness, if it is generated static, the generated every page is different, each generation is different. But the virtual host user when the CPU peak is less than 5%, and you have to generate a static page, the generation of more than 700 articles will likely cause the process as a machine. It is recommended that when generating a large number of static pages, look for fewer visitors and try to generate as few as possible. You can also modify the config.asp files in the dynamic installation directory:

Const MAXPERPAGE_CREATE = 10 ' One generation quantity, change him smaller, const SLEEPTIME = 3 ' Generation interval, make him bigger.

Reference documents:

Site collection rate of concern: http://www.make-dress.com.cn, http://www.gongzuofuf.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.