ThinkPHP开启设置子域名笔记


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

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

二、apache httpd.config

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

三、httpd-vhosts.conf

添加

<VirtualHost *:80>
ServerName 一级域名
ServerAlias 二级域名
DocumentRoot D:/wamp64/www/文件名
<Directory "D:/wamp64/www/文件名/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

四、修改hosts文件

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

添加

127.0.0.1   一级域名   二级域名


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM