Two-level domain name binding to subdirectories "good!" 】

Source: Internet
Author: User

A set of million network domain name + space, a set of 90 sail host +TK free domain name, seemingly do not support the binding subdirectory, MOM eggs!

Find a way on the net, feasible, the virtual host seems to need to support PHP system, the Web directory to create a. htaccess file, if the prompt "file name cannot be empty", open-Save As-all files, you can change the name.

This rewrite writing seems to involve pseudo-static, to find a detailed article:

URL rewriting: Rewritecond instruction and Rewriterule instruction format

The main function of Rewirte is to implement the URL jump and hide the real address, based on the Perl language regular expression specification. Usually help us to achieve quasi-static, quasi-directory, domain name jump, prevent hotlinking and so on.

My Code:

1 # Open the Rewriteengine mode2 Rewriteengine on3 4Rewitebase/5 6Rewritecond%{http_host} ^ (bbs\.)?tuwenclub\.com$ [NC]7Rewritecond%{request_uri}!^/Bbs/8Rewritecond%{request_filename}!-F9Rewritecond%{request_filename}!-DTenRewriterule ^ (. *) $ BBS/$ One # No default to enter the file name to the first page ARewritecond%{http_host} ^ (bbs\.)?tuwenclub\.com$ [NC] -Rewriterule ^ (/)? $ bbs/forum.php [L]

Online A annotated code, should be the same as mine, in order to prevent their inability to run, two are affixed to the, because this has a note, as a reference:

create a new. htaccess file at the root of the Web site, adding the following statement to the file: Rewriteengine on # change bbs.dakm.cn to the domain you want to bind. Rewritecond%{http_host} ^ (www.)?bbs.dakm.cn$ # Change the BBS to the directory to bind. Rewritecond%{request_uri}!^/Bbs/# do not change the following two lines. Rewritecond%{request_filename}!-F Rewritecond%{request_filename}!-D # Change the BBS to a directory to bind to. Rewriterule^(.*)$/Bbs/$# change bbs.dakm.cn to the domain you want to bind # change the BBS to a directory to bind to. # BBS/the back is home file index.php, index.html ... Rewritecond%{http_host} ^ (www.)?bbs.dakm.cn$ Rewriterule^(/)? $ bbs/index.php [L] above the entire set of statements is bound to a subdirectory, if you want to bind more than one subdirectory, you can add the above statement repeatedly! 

Two-level domain name binding to subdirectories "good!" 】

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.