一、ThinkPHP框架里 common下的config文件,二、apache httpd.config,开启 Include conf/extra/httpd-vhosts.conf,三、httpd-vhosts.conf,添加,四、修改hosts文件,C:\Windows\System32\drivers\etc目录下,添加,127.0.0.1 一级域名 二级域名,文章来源:https://www.cnblogs.com/dreamflycc/p/subdomain.html,

一、ThinkPHP框架里 common下的config文件

  1. 'APP_SUB_DOMAIN_DEPLOY' => 1, // 开启子域名配置  
  2. 'APP_SUB_DOMAIN_RULES' => array(  
  3. 'doctor' => 'Doctor', // doctor域名指向Doctor模块  
  4. ),  

二、apache httpd.config

开启 Include conf/extra/httpd-vhosts.conf

三、httpd-vhosts.conf

添加

  1. <VirtualHost *:80>  
  2. ServerName 一级域名  
  3. ServerAlias 二级域名  
  4. DocumentRoot D:/wamp64/www/文件名  
  5. <Directory "D:/wamp64/www/文件名/">  
  6. Options +Indexes +Includes +FollowSymLinks +MultiViews  
  7. AllowOverride All  
  8. Require local  
  9. Directory>  
  10. VirtualHost>  

四、修改hosts文件

C:\Windows\System32\drivers\etc目录下

添加

127.0.0.1 一级域名 二级域名

文章来源:https://www.cnblogs.com/dreamflycc/p/subdomain.html

,

一、ThinkPHP框架里 common下的config文件

  1. 'APP_SUB_DOMAIN_DEPLOY' => 1, // 开启子域名配置  
  2. 'APP_SUB_DOMAIN_RULES' => array(  
  3. 'doctor' => 'Doctor', // doctor域名指向Doctor模块  
  4. ),  

二、apache httpd.config

开启 Include conf/extra/httpd-vhosts.conf

三、httpd-vhosts.conf

添加

  1. <VirtualHost *:80>  
  2. ServerName 一级域名  
  3. ServerAlias 二级域名  
  4. DocumentRoot D:/wamp64/www/文件名  
  5. <Directory "D:/wamp64/www/文件名/">  
  6. Options +Indexes +Includes +FollowSymLinks +MultiViews  
  7. AllowOverride All  
  8. Require local  
  9. Directory>  
  10. VirtualHost>  

四、修改hosts文件

C:\Windows\System32\drivers\etc目录下

添加

127.0.0.1 一级域名 二级域名

文章来源:https://www.cnblogs.com/dreamflycc/p/subdomain.html

最后修改:2025 年 09 月 10 日
如果觉得我的文章对你有用,请随意夸赞