本地Web项目使用localhost域名FQDN。 我需要configuration我的Windows DNS吗?

我的本地Apache服务运行得很好。 我正在运行WAMP。

我试图configuration我的.httpd文件,以便我可以像完全限定的域名一样访问特定的项目:mysite.com(但parsing为像localhost / myfoldername /)。

我能够得到它使用不同的端口号,如:

localhost:8080 

localhost:80是我的根网站目录。

这是我目前的.httpdconfiguration:

listening: 80 (在.httpd中定义更高)

….被添加到我的.httpd

 NameVirtualHost 127.0.0.1:8080 Listen 127.0.0.1:8080 <VirtualHost 127.0.0.1:8080> ServerName www.jobeet.com DocumentRoot "C:\wamp\www\symfony\jobeet\web" DirectoryIndex index.php <Directory "C:\wamp\www\symfony\jobeet\web"> AllowOverride All Allow from All </Directory> Alias /sf C:\wamp\www\symfony\jobeet\lib\vendor\symfony-1.4.8\data\web\sf <Directory "C:\wamp\www\symfony\jobeet\lib\vendor\symfony-1.4.8\data\web\sf"> AllowOverride All Allow from All </Directory> </VirtualHost> 

这里是我的Windows主机文件configuration:

 127.0.0.1 localhost 127.0.0.1:8080 www.jobeet.com.localhost 

如果有人有任何想法,请告诉我! 我已经超过8小时了:(thx。

主机文件只支持IP地址到名称的转换,所以:8080完全没有意义。

另外,由于主机文件根本不是DNS,所以不要input任何search后缀,因此只能input整个域名。 所以.localhost从它转储.localhost 。 它应该是:

 127.0.0.1 localhost 127.0.0.1 www.jobeet.com 

当然,那么你将失去对REAL www.jobeet.com所有访问权限,但是你不能两面兼顾。