全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 2228|回复: 10
打印 上一主题 下一主题

拜年了!让子域名看起来象主域名的子目录结构

[复制链接]
1#
发表于 2019-2-6 12:42:02 | 显示全部楼层
Open file: /etc/apache2/sites-enabled/000-default.conf

Or you can create a separate configuration file as you prefer I keep all my VHosts in one file. Once you have the configuration file open add new VHost configuration like so:

  1. <VirtualHost *:80>
  2.     DocumentRoot /var/www/subfolder
  3.     ServerName www.domain.com
  4.     ServerAlias domain.com
  5. </VirtualHost>
复制代码

Now go back to the folder: /etc/apache2 and open file: apache2.conf and add a new line:

ServerName www.domain.com

Save the file and restart your server using this command: service apache2 restart, the process is same across all OS the config folder locations tho can be different you can look those up.

---

以上是一个网站的方法,多个应该同理,复制粘贴,懒得打了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-25 23:01 , Processed in 0.057601 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表