teach you to use. htaccess implement a Web site space multiple level two domain names

Source: Internet
Author: User
Keywords Old domain name level two domain name implementation multiple

There are a lot of personal webmaster, specifically registered to give up the old domain name to do the station, they believe that even the old domain name of the two-level domain name, compared to the new domain name to have advantages. Is that absolutely true? The view of Hong Yi is:

1, the old domain name certainly than the newly registered domain name has the advantage.

2, the old domain name of the two-level domain name than the new domain has the advantage of the problem to distinguish to see:

If the old domain name is now very high, such as those big site domain name, such as **.baidu.com weight is certainly higher than the new domain name a lot.

General old domain name (such as only 2 years, PR in 3 or so, two domain name less than 5), will be better than the new domain name: including the speed of collection, the initial ranking, etc., but will not have a significant advantage.

3, the use of the old domain name also has many risks: for example, you register the old domain name is a search engine penalty domain name.

4, some people summed up the use of the old domain name of several conditions: the domain name has a certain external links, the domain name of the external link for some time, the domain name has a specific meaning, and easy to remember, if the old domain name can not meet these conditions, the new domain name as far as possible

5, register the old domain name as we usually buy second-hand, perhaps is leackage, perhaps is to seek to smoke.

I have opened a stand-alone IP Linux space from the website, the space supports pseudo static function. Because the site root directory installed is the Dedecms,bbs directory installed is the forum, the home directory installation is Ucenterhome, the virtual host only support the root directory binding domain name, how to allow the site to support the two-level domain name? I'll teach you how to use. htaccess to achieve a Web site space can use more than two domain names to point to multiple level two directory, to establish multiple sites. Take a standalone IP virtual host for example:

First, the domain name to do a pan-resolution *.xxxx.com resolution to your space IP, independent IP virtual host support pan-resolution, do not need to bind domain names can access the site.

Second, the establishment of BBS, home directory, the CMS uploaded to the root directory, the forum uploaded to the BBS directory, will ucenterhome upload to the home directory.

Third, open Notepad to copy the following code into, save as. htaccess file, upload to root directory.

The contents of the. htaccess file are as follows: (take xxx.cn domain name as an example)

Rewriteengine on

DirectoryIndex index.php index.html index.htm

#让www. xxx.cn access to the root directory cms

Rewritecond%{http_host} ^www.xxx.cn$

Rewritecond%{request_uri}!^/

Rewritecond%{request_filename}!-f

Rewritecond%{request_filename}!-d

Rewriterule ^ (. *) $/$1

Rewritecond%{http_host} ^www.xxx.cn$

Rewriterule ^ (/) $/index.php [L]

#让home. xrnic.cn access to the home directory Ucenterhome

Rewritecond%{http_host} ^home.xxx.cn$

Rewritecond%{request_uri}!^/home/

Rewritecond%{request_filename}!-f

Rewritecond%{request_filename}!-d

Rewriterule ^ (. *) $/home/$1

Rewritecond%{http_host} ^home.xxx.cn$

Rewriterule ^ (/) $ home/index.php [L]

#让bbs. xrnic.cn Access BBS Directory Forum

Rewritecond%{http_host} ^bbs.xxx.cn$

Rewritecond%{request_uri}!^/wap/

Rewritecond%{request_filename}!-f

Rewritecond%{request_filename}!-d

Rewriterule ^ (. *) $/bbs/$1

Rewritecond%{http_host} ^bbs.xxx.cn$

Rewriterule ^ (/) $ bbs/index.php [L]

According to the above method can be a space to establish n sites, of course, you can also put other top-level domain name to the subdirectory, to achieve a space to establish a number of Web site functions. The above tutorial by the old webmaster Xrnic finishing, I hope a lot of space to build a number of Web site friends can use, reproduced please indicate from www.xrnic.cn, thank you.

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.