Tag:http os file sp on c linux ef server
First, you have a top-level domain name that has a pan-name resolution, for example: domain.com
Second, after opening mod_rewrite
in httpd.conf, at the end of httpd.conf, add the following:
Rewritee Ngine on
Rewritemap lowercase int:tolower
rewritemap vhost txt:/usr/local/etc/apache/vhost.map
RewriteCond ${lowercase:%{server_name}} ^ (. +) $
Rewritecond ${vhost:%1} ^ (/.*) $
Rewriterule ^/(. *) $%1/$1
where/usr/loca L/etc/apache is the path to your Apache server configuration file, which is changed according to the actual situation.
then create a file in the directory where the path is located: Vhost.map
:
Www.domain.com /usr/local/www/data-dist/domain
Bbs.domain.com/usr/local/www/data-dist/bbs
Anyname.domain.com/usr/local/www/data-dist/anyname
The above sections are: "Domain name + Space + absolute path "in the form.
Finally, under your Web site root directory/usr/local/www/data-dist, create the corresponding directory:
domain, BBS, anyname and so on, theoretically can be unlimited.
This way, when you access www.domain.com through a browser, you actually access the files in the/usr/local/www/data-dist/domain directory. Similarly, access to bbs.domain.com actually accesses files in the/usr/local/www/data-dist/bbs directory. Also, you can
change vhost.map at any time to add, delete, modify your level two domain name and the actual path you are pointing to, without restarting Apache
Linux level two domain name settings