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)