Linux host Bindings subdirectory (Linux host level two domain setting)

Source: Internet
Author: User
Tools/Materials

Linux Virtual Host

. htaccess file

For Windows hosts, you need to configure the Httpd.ini file to bind subdirectories, and for Linux hosts, you need to configure the. htaccess file.

It may be easier to understand this by example, such as you want to do a two-level domain name like wap.201410.com, first to ensure that there is a normal access to the WAP directory under the site root directory

Download the. htaccess file under the root directory of the Web site. (If you don't have this file, you can create a new TXT-formatted text document on your desktop and rename it to. htaccess)

Open the. htaccess file with Notepad and paste the following code into the file, save it.

Rewriteengine on

DirectoryIndex index.php index.html index.htm

Rewritecond%{http_host} ^wap.201410.com$

Rewritecond%{request_uri}!^/wap/

Rewritecond%{request_filename}!-f

Rewritecond%{request_filename}!-d

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

Rewritecond%{http_host} ^wap.201410.com$

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

Upload the. htaccess file to the root of your Web site, and you'll be able to access level two domain names. Above just do an example, wherein WAP is you need to modify the prefix for your own two-level domain name, 201410.com is the site's main domain!

Ding Feng Xiao Hu
qq.2881064155
[Email protected]

Linux host Bindings subdirectory (Linux host level two domain setting)

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.