Use 301 Redirect to solve DZ forum domain name Access Multi-entry problem

Source: Internet
Author: User

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

Some netizens have been asking me this question:

DZ Station binding 2 domain name problem, the portal domain name is WWW, the default is all WWW, forum domain name is two bbs, normal access will not cause multiple import problems! But Baidu Crawl, will be the forum's post crawl to the WWW domain name, the portal of the post crawl to the BBS, Such words may result in duplicate collection, scatter weight, leading to the right to fall!

So I came to DZ website only looked at the station, but also can be more than the entrance, and then search for a question, many people have been asked, the last is not resolved, the official website also no one out to send a tutorial to see, this problem has been stranded, is there no solution?

The answer is YES!

So I thought about the 301 orientation is not able to solve this problem? So the majority of the study of genius to solve the problem!

First of all, I declare that my server is using Nginx, and if I use Apache, I can write against Apache rules.

For example, my site, portal binding domain name: www.mobipop.cn and mobipop.cn forum bound domain name: bbs.mobipop.cn

First on the server to establish two Web sites, if only to establish a website, the rules put in the words, you visit, will be prompted multiple 301 directional problems, this is impossible to solve! The solution must establish two Web sites, as follows:

One: bbs.mobipop.cn Build a website

Second: www.mobipop.cn and mobipop.cn to establish a website, this building, the direct use of the BBS program on the line! No More Programs!

This time need to configure the file, place 301 redirect code;

1: When configuring the WWW Web site, the 301 redirect code (The following code is written by myself according to the rules, absolutely no on the internet OH) put to the corresponding configuration file, different servers place different places, here is not much to say, do forum people should understand, the following code into your own URL on the line!

The code is as follows:

if ($host = ' mobipop.cn ') {

Rewrite ^/(. *) $ http://www.mobipop.cn/$1 permanent;

}

rewrite ^ ([^\.] *)/thread-([0-9]+)-([0-9]+)-([0-9]+) \.html$ http://bbs.mobipop.cn/thread-$2-$3-$4.html;

rewrite ^ ([^\.] *)/forum-(W)-([0-9]+) \.html$ http://bbs.mobipop.cn/forum-$2-$3.html Permanent;

rewrite ^ ([^\.] *)/archiver/tid-([0-9]+) \.html$ http://bbs.mobipop.cn/archiver/tid-$2.html Permanent;

rewrite ^ ([^\.] *)/archiver/fid-([0-9]+) \.html$ http://bbs.mobipop.cn/archiver/fid-$2.html Permanent;

rewrite ^ ([^\.] *)/archiver/$ http://bbs.mobipop.cn/archiver/permanent;

2: When configuring the WWW Web site, the 301 redirect code is placed in the appropriate configuration file.

The code is as follows:

rewrite ^ ([^\.] *)/article-([0-9]+)-([0-9]+) \.html$ http://www.mobipop.cn/article-$2-$3.html Permanent;

3: Then restart Nginx, if it is Apache, restart the Apache on the line, this time you will find, is the forum of posts, will jump to BBS, is the portal posts, will jump to the www.

4: The problem has been solved, check more than a few times on the line!

I hope to use DZ as a forum webmaster may wish to see, to accumulate the weight of the forum is very helpful!

This article is all bubble network administrator, the above 301 directional code is also original all! Not for commercial use!

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.