Apache程序由wamp打包安装完成

单IP绑定多域名站点开始

打开安装目录Apache下的conf目录,选择httpd.conf文件。

查找代码
# Include conf/extra/httpd-vhosts.conf

替换为
NameVirtualHost *:80

<VirtualHost *:80>

ServerName www.7drt.com        //这里修改你自己的域名

ServerAlias localhosts

DocumentRoot c:/usr/www       //这里是网站路径



<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic-(.+)\.shtml$ $1/portal.php?mod=topic&topic=$2&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.shtml$ $1/portal.php?mod=view&aid=$2&page=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.shtml$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.shtml$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.shtml$ $1/forum.php?mod=group&fid=$2&page=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/space-(username|uid)-(.+)\.shtml$ $1/home.php?mod=space&$2=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.shtml$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.shtml$ $1/index.php?action=$2&value=$3&%1

</IfModule>




</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
ServerName  bbs.7drt.com
ServerAlias localhost
DocumentRoot c:/usr/www/novel




<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/sort/([0-9]+)/([0-9]+).shtml$ $1/sort.php\?sortid=2&page=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/over/([0-9]+).shtml$ $1/over.php\?&page=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/top/(.*)/([0-9]+).shtml$ $1/top.php\?topid=$2&page=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topover/(.*)/([0-9]+).shtml$ $1/topover.php\?topid=$2&page=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/book/([0-9]+).shtml$ $1/book.php?\bookid=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/down/(.*)/([0-9]+).shtml$ $1/down.php\?bookid=$3&type=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/readend/([0-9]+).shtml$ $1/readend.php?\bookid=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/read/([0-9]+)/([0-9]+).shtml$ $1/read.php\?cutid=$2&bookid=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/chapter/([0-9]+)/([0-9]+)/([0-9]+).shtml$ $1/chapter.php\?cutid=$2&bookid=$3&chapterid=$4

</IfModule>


</VirtualHost>



<IfModule mod_rewrite.c>
</Ifmodule>
之间的代码为伪静态规则
其它的可以对应修改

最后修改完成保存文件,重新启动Apache服务器就OK了