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