我在创建虚拟主机时遇到了问题。我正在使用Windows 7 x64 Professional。在文件C:\Windows\System32\drivers\etc\hosts
我只有这行:配置虚拟主机和本地主机重定向到xampp文件夹
127.0.0.1 myhost
127.0.0.1 www.myhost
而且在文件C:\xampp\apache\conf\extra\httpd-vhosts.conf
我有这样的:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/"
ServerName localhost
ServerAlias www.localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/Users/Me/Dropbox/Project/public"
ServerName myhost
ServerAlias www.myhost
<Directory "C:/Users/Me/Dropbox/Project/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
当然,我已经将这些文件中这一行之后restared我的Apache服务器。 不幸打字myhost
或www.myhost
在我的浏览器上将我重定向到myhost/xampp
。
我已经搜索和我已经在谷歌发现也计算器描述了如何使用XAMPP配置虚拟主机,但我怎么能认识我所做的一切都是正常的。我知道我的问题不是新的,但我没有找到适合我的工作解决方案。
我也认识到打字localhost
在我的浏览器中重定向我alsto localhost/xampp
。我不知道这些问题是否与我的情况相关。
遵循以下已工作液URL [本地主机与虚拟主机和工作(http://stackoverflow.com/a/39037872/2363138) – Raj 2016-08-19 11:31:21