如何在wamp堆栈中创建动态虚拟主机

时间:2014-12-30 09:51:24

标签: php wamp virtualhost

我找到了一种动态创建虚拟主机的方法我试过这个但是它没有工作

<VirtualHost *:80>
    UseCanonicalName Off
    ServerAlias *
    VirtualDocumentRoot "D:/WAMP/apache2/htdocs/projects/%0/current"
    VirtualScriptAlias "D:/WAMP/apache2/htdocs/projects/%0/current"
    LogLevel debug
    <Directory "D:/WAMP/apache2/htdocs/projects/">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order Allow,Deny
        Allow from all
        Require local
    </Directory>
</VirtualHost>

我也设置了hosts文件但是当我加载我的vhost名称时,它会加载localhost索引文件而不是我的项目。我只想这样做,以减少设置新项目的麻烦:)谢谢。我使用的是Windows 8.1。

0 个答案:

没有答案