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

在httpd.conf中添加如下内容

顶级域名指定一个目录

<VirtualHost *:80>
  ServerAdmin admin@potatog.com
  DocumentRoot "C:\xampp\htdocs"
  ServerName www.potatog.com
  ErrorLog "C:\xampp\apache\logs\www.potatog.localhost-error.log"
  CustomLog "C:\xampp\apache\logs\www.potatog.localhost.access.log" combined
</VirtualHost>

二级域名指定一个目录

<VirtualHost *:80>
  ServerAdmin admin@potatog.com
  DocumentRoot "C:\xampp\htdocs\api"
  ServerName api.potatog.com
  ErrorLog "C:\xampp\apache\logs\api.potatog.localhost-error.log"
  CustomLog "C:\xampp\apache\logs\api.potatog.localhost.access.log" combined
</VirtualHost>

参考:

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

最新文章

  1. Django 之 分表
  2. java名词解释
  3. JavaScript中instanceof运算符的用法以及和typeof的区别
  4. filesort
  5. Windows命令行中使用SSH连接Linux
  6. CardView官方教程
  7. Cretiria查询应用(一)
  8. listbox横向排列
  9. sql差异
  10. session和application内置对象
  11. Python日志模块logging用法
  12. 跟技术胖学vue+koa
  13. 关于多线程之GCD的一些学习要点
  14. 《MySQL:菜鸟入门系列》
  15. charles 手机抓包 unknown
  16. JS数组去重办法大全
  17. centos firewall-cmd常用命令
  18. Button或者ImageButton的背景设为透明或者半透明
  19. 理解域名插槽:slot-scope
  20. 窗口点击模拟a

热门文章

  1. POJ1151 离散化求矩形面积的并
  2. maven编译报错 错误: -source 1.5 中不支持 lambda 表达式
  3. Django-2.2.1学习感悟
  4. 阿里云MaxCompute 2019-7月刊
  5. 微信小程序-- WXML语法
  6. C#中抽象方法与虚方法的区别(转)
  7. 牛人也得看的CSS常识
  8. Ajax系列之二:核心对象XMLHttpRquest
  9. ubuntu 安装 lrzsz 上传下载
  10. Git.之.安装