加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows 下的 Apache 二级域名 目录绑定配置

发布时间:2020-12-14 04:28:21 所属栏目:Windows 来源:网络整理
导读:通常我们注册的域名都是顶级域名? 如 www.potatog.com,我们希望这个域名可以访问服务器的不同网站或者不同功能等等 可能会这样 www.potatog.com/api 或者 www.potatog.com/admin,另一种二级域名的方式 api.potatog.com来指向特定目录 在httpd.conf中添加如

通常我们注册的域名都是顶级域名? 如 www.potatog.com,我们希望这个域名可以访问服务器的不同网站或者不同功能等等 可能会这样 www.potatog.com/api 或者 www.potatog.com/admin,另一种二级域名的方式 api.potatog.com来指向特定目录

在httpd.conf中添加如下内容

顶级域名指定一个目录

<VirtualHost *:80>
? ServerAdmin [email?protected]
? DocumentRoot "C:xampphtdocs"
? ServerName www.potatog.com
? ErrorLog "C:xamppapachelogswww.potatog.localhost-error.log"
? CustomLog "C:xamppapachelogswww.potatog.localhost.access.log" combined
</VirtualHost>

二级域名指定一个目录

<VirtualHost *:80>
? ServerAdmin [email?protected]
? DocumentRoot "C:xampphtdocsapi"
? ServerName api.potatog.com
? ErrorLog "C:xamppapachelogsapi.potatog.localhost-error.log"
? CustomLog "C:xamppapachelogsapi.potatog.localhost.access.log" combined
</VirtualHost>

参考:

https://www.cnblogs.com/phonecom/p/6363268.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读