我有两个装置的拉拉。一个在一个名为"laravel"的文件夹中,另一个在名为的文件夹中它们都是位于同一个父文件夹中的兄弟姐妹。在我安装"learningLaravel"之前,我曾经通过localhost/laravel/public访问"laravel"中的站点,一切都很好。
安装"learningLaravel",后,我决定在我的WAMP服务器上创建一个虚拟主机,名为"learningLaravel.dev"。我的windows/system32 32/drivers/etc/host文件如下所示:
127.0.0.1 localhost
127.0.0.1 localhost
// I added this entry. The first two entries above was already there
127.0.0.1 learninglaravel.dev我在Apache的“httpd-vhosts.conf”中添加了以下内容:
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/learningLaravel/public"
ServerName learningLaravel.dev
</VirtualHost>现在我可以通过"learningLaravel"通过learningLaravel.dev.访问但是,当我想通过localhost/laravel/public访问"laravel"文件夹中的站点时,我会收到一条消息:
Not Found
The requested URL /laravel/public was not found on this server.我也尝试本地主机,我得到:
Not Found
The requested URL / was not found on this server.我现在遇到的问题是,从localhost开始的任何东西都不能工作,但是learningLaravel.dev可以工作。
我需要做什么改变?谢谢。
发布于 2015-07-17 06:46:46
只需定义两个虚拟主机:
domain1.dev、domain2.dev、domain3.dev和localhost。learninglaravel.dev。httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/"
ServerName localhost
ServerAlias *.localhost
</VirtualHost>
<VirtualHost learninglaravel.dev:80>
DocumentRoot "c:/wamp/www/learningLaravel/public"
ServerName learninglaravel.dev
ServerAlias *.learninglaravel.dev
</VirtualHost>windows/system32 32/驱动程序/etc/主机
127.0.0.1 learninglaravel.dev
# you don't need the following this is just for explanation:
127.0.0.1 domain1.dev
127.0.0.1 domain2.dev
127.0.0.1 domain3.devhttps://stackoverflow.com/questions/31469390
复制相似问题