wamp配置虚拟域名

1、打开apache下httpd.conf

我的目录是在F:\wamp\bin\apache\apache2.2.22\conf\httpd.conf

2、去掉这两行前面的#注释

LoadModule rewrite_module modules/mod_rewrite.so

Include conf/extra/httpd-vhosts.conf

这两个注释

3、配置httpd-vhosts.conf

<VirtualHost *:80>
  ServerName i.fx-dev.com //配置域名
  DocumentRoot "F:\root" //配置运行目录

  #RewriteEngine on //需要时配置重写

  #RewriteCond $1 !^(index\.php|aaa)

  #RewriteRule ^(.*)$ /test/test.php/$1 [L]

  <Directory "F:\root"> //目录的权限一定要配置
    AllowOverride all
    Order Deny,Allow
    Allow from all
  </Directory>
</VirtualHost>

4、配置hosts

127.0.0.1 i.fx-dev.com

5、重启wamp

posted @ 2015-06-29 20:52  北京流浪儿  阅读(499)  评论(0编辑  收藏  举报