域到XAMPP Apache

域到XAMPP Apache,xampp,Xampp,我有一个带有静态IP的WEB服务器,安装了带有XAMPP apache的Windows。我在D驱动器中创建了一个目录WEBPROG,它是我所有网站的程序。我购买域名并指向我的WEB服务器IP。但我想直接指向D:\WEBPROG,当我进入www.mywebsite.com时,它不会显示该网站。我必须进入www.mywebsite.com/WEBPROG,然后它就会出现。我尝试了virtualhost配置,但它似乎不起作用。有人可以建议这个虽然我已经搜索了很多网站,尝试他们的建议,但它不起作用 谢谢

我有一个带有静态IP的WEB服务器,安装了带有XAMPP apache的Windows。我在D驱动器中创建了一个目录WEBPROG,它是我所有网站的程序。我购买域名并指向我的WEB服务器IP。但我想直接指向D:\WEBPROG,当我进入www.mywebsite.com时,它不会显示该网站。我必须进入www.mywebsite.com/WEBPROG,然后它就会出现。我尝试了virtualhost配置,但它似乎不起作用。有人可以建议这个虽然我已经搜索了很多网站,尝试他们的建议,但它不起作用

谢谢


Gad

这是XAMPP(apache/conf/extra)中httpd-vhosts.conf的豁免:

NameVirtualHost*:80
DocumentRoot/www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog@rel_logfiledir@/dummy-host.example.com-error_log
CustomLog@rel_logfiledir@/dummy-host.example.com-access_log common

将此配置用作模板,并确保将DocumentRoot指定为d:/webprog。请注意,名称VirtualHost是使域名与VirtualHost指令一起工作所需的。这是XAMPP(apache/conf/extra)中httpd-vhosts.conf的豁免:

NameVirtualHost*:80
DocumentRoot/www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog@rel_logfiledir@/dummy-host.example.com-error_log
CustomLog@rel_logfiledir@/dummy-host.example.com-access_log common
将此配置用作模板,并确保将DocumentRoot指定为d:/webprog。请注意,NameVirtualHost是使域名与VirtualHost指令一起工作所需的名称

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /www/docs/dummy-host.example.com
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog @rel_logfiledir@/dummy-host.example.com-error_log
    CustomLog @rel_logfiledir@/dummy-host.example.com-access_log common
</VirtualHost>