Find the conf/httpd. conf file in the apache installation root directory, and open the file with a line at the bottom.
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Check whether the line include conf/extra/httpd-vhosts.conf is commented out. If commented out, cancel the comment.
Open the conf/extra/httpd-vhosts.conf file and create a new virtual machine in the file
For example, to bind a domain name to www.111cn.net
<Virtualhost *: 80>
Documentroot "/home/aaa.com" // full path of the website
Servername www.111cn.net // domain name to be bound
Directoryindex index.html // The homepage file opened by default.
</Virtualhost>
Apache pseudo-static settings
1. Open the configuration file httpd. conf of apache.
2. Remove the # loadmodule rewrite_module modules/mod_rewrite before #.
3. Add the following in httpd. conf:
<Ifmodule mod_rewrite.c>
Rewriteengine on
# Rewritecond % {env: script_url }(? : Index | dispbbs00000000-0-900000000.html
Rewriterule ^ (.*? (? : Index | dispbbs00000000-(-0-942500000000.html $1. php Tutorial? _ Is_apache_rewrite = 1 & __ rewrite_arg = $2
</Ifmodule>
4. To map asp post URLs to php posts, add the following between <ifmodule mod_rewrite.c> and </ifmodule> in Step 3:
Rewritemap tolowercase int: tolower
Rewritecond % {query_string }(? : Boardid | page | id | replyid | star | skin) = d + [nc]
Rewriterule ^ (.*(? : Index | dispbbs). asp $ 1.php? $ {Tolowercase: % {query_string }}&__ is_apache_rewrite = 1
5. Save httpd. conf and restart apache.
Depending on different services and installations, conf/httpd under apache. conf will be different. Therefore, many new website builders on the internet fail to set their own sites in a successful way. Next, I will first describe the correct setting method, and then explain the cause of the failure.