About the site subdirectory binding level two domain name method (PHP website mobile side)

Source: Internet
Author: User

Recently help customers do Zencart website mobile template used to two level domain name, by judging the phone access to call two level directory program, http://afish.cnblogs.com/How to say than http://www.cnblogs.com/afish/look comfortable
If your host space supports sub-directories to bind level two domain names, here are the methods for sub-directories to bind level two domain names:
First, in the domain management background to add a two-level domain name "alias (CNAME)", I have added a "afish.cnblogs.com" of the two-level domain name

Second, enter the host management background, in the "sub-Directory Binding" page, add this level two domain name

Three, set up, two-level domain name can be used immediately.

What if your host does not support the binding subdirectory? If you are using a PHP host, you can try the following methods.

Create a new one in the Web site root directory.htaccess file, include the following statement in this file: Rewriteengine on#change the afish.cnblogs.com to the domain you want to bind.Rewritecond%{http_host} ^ (www.)?afish.cnblogs.com$#change the afish to the directory you want to bind.Rewritecond%{request_uri}!^/afish/#do not change the following two lines.Rewritecond%{request_filename}!-Frewritecond%{request_filename}!-D#change the afish to the directory you want to bind.Rewriterule ^ (. *) $/afish/$1#change the afish.cnblogs.com to the domain you want to bind#change the afish to the directory you want to bind.#afish/Back is home file index.php, index.html ...Rewritecond%{http_host} ^ (www.)?Afish.cnblogs.com$rewriterule^ (/)? $ afish/index.php [L] above the entire set of statements is bound to a subdirectory, if you want to bind multiple subdirectories, you can add the above statement repeatedly! 

About the site subdirectory binding level two domain name method (PHP website mobile side)

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.