Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall
For some directories, we often need to specify a level two domain name, then how to operate?
Because of my first contact with CentOS, I had to use network resources. Then know to open mod_rewrite This module, the specific method is as follows:
Open the Apache installation directory with a text editor/etc/httpd/conf\httpd.conf, find the "#LoadModule rewrite_module modules/mod_rewrite.so" line, remove the front "#"; Continue to find "allowoverride None", modify it to "allowoverride all", and then restart Apache.
So, it opens the Mod_rewrite module, its function is very powerful, here I only talk about how to bind the level two domain name.
Again, we enter the following statement at the end of the httpd.conf file:
Rewriteengine on
Rewritemap lowercase Int:tolower
Rewritemap Vhost Txt:/etc/httpd/vhost.map
Rewritecond ${lowercase:%{server_name} ^ (. +) $
Rewritecond ${vhost:%1} ^ (/.*) $
Rewriterule ^/(. *) $%1/$1
and restart Apache.
In this way, we are free to set the binding level two domain name.
Warm tip: This httpd.conf everyone pay attention to backup, I have accidentally deleted, made extremely miserable ah!!
Then create a new Vhost.map in the/ETC/HTTPD (that is, the Apache installation directory) and bind with a text editor, which is very simple, as I wrote:
Bbs.nvdchina.com/var/www/html/bbs
Home.nvdchina.com/var/www/html/home
Potplayer.nvdchina.com/var/www/html/potplayer
We can bind the level two domain name to the directory, save on the line, and do not need to restart Apache, very convenient.