ThinkPHP開源框架二級域名配置方法介紹
1、Application /Common / Conf / config.php中加:
'APP_SUB_DOMAIN_DEPLOY' => 1,
'APP_SUB_DOMAIN_RULES' => array(
'yi' => 'Home/Yi',
'shi' => 'Home/Shi',
'zhu' => 'Home/Zhu',
'xing' => 'Home/Xing',
), // 子域名部署規(guī)則
2、在vhosts.conf中添加:
<VirtualHost *:80>
DocumentRoot "E:\WWW\wangzhan"
ServerName www.abc.com
ServerAlias *.abc.com
<Directory "E:\WWW\wangzhan">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
若是phpStudy,打開“站點域名管理”,新增:
網(wǎng)站域名:www.abc.com
網(wǎng)站目錄:E:\WWW\wangzhan
第二域名:*.abc.com
最后保存配置,重啟。