Improve the Discuz portal article by Baidu included method

Source: Internet
Author: User

If you know SEO, you should clearly use the canonical URL tag can be fixed page standard address, can improve the weight of web pages, is conducive to search engine inclusion.

For example, my site has two sub-domains www.bbseat.com.cn and bbs.bbseat.com.cn, can access the same article page, then this setting will spread the weight of the page, not conducive to inclusion. Use the canonical URL tag to specify a standard address for the Web page, you can improve the weight of the page to facilitate inclusion.

But you can look at the portal and Forum source code, you will find that forum posts have canonical URL and portal article does not.

Let's take a look at the portal article how to add canonical URL tags:

Locate the source/module/portal/portal_view.php file.

Search:

require_once libfile (' Function/blog ');

Then add the following code in the upper margin of this line of code:

if (@in_array$_g[' Setting '] [' rewritestatus ']) {    $canonical$_get[' Aid 'else  {    $canonical = ' Portal.php?mod=view&aid= '. $_get [' Aid '];} $_g [' Setting '] [' seohead ']. = ' <link href= '. $_g [' SiteURL ']. $canonical. ' " Rel= "canonical"/> ';

After saving, open the portal article and see if the source code </title> tag is already tagged with the canonical URL (this method applies to both turn on and off pseudo-static).

Improve the Discuz portal article by Baidu included method

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.