好学若饥 - 让我们共同前行!

好学网


当前位置: 好学网首页 > IT教育 > 编程开发 >

用.htaccess实现二级域名功能

时间:2018-06-01 16:17来源:好学网 作者:haoxuee 点击:
.htaccess设置以下: RewriteEngine on RewriteCond %{HTTP_HOST} ^www.aoyou0898.com$ RewriteCond %{REQUEST_URI} !^/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /$1 RewriteCond %{HTTP_HOST} ^www.a

 .htaccess设置以下:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.aoyou0898.com$
RewriteCond %{REQUEST_URI} !^/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /$1
RewriteCond %{HTTP_HOST} ^www.aoyou0898.com$
RewriteRule ^(/)?$ /index.php [L]
#主站的伪静态写在以下
#主站的伪静态写在以上
RewriteCond %{HTTP_HOST} ^<span style="font-family: Arial, Helvetica, sans-serif;">qxc</span><span style="font-family: Arial, Helvetica, sans-serif;">.aoyou0898.com$</span>
RewriteCond %{REQUEST_URI} !^/qxc/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /qxc/$1
RewriteCond %{HTTP_HOST} ^<span style="font-family: Arial, Helvetica, sans-serif;">qxc</span>.aoyou0898.com$
RewriteRule ^(/)?$ <span style="font-family: Arial, Helvetica, sans-serif;">qxc</span>/index.php [L]

(责任编辑:haoxuee)

      学友请微信搜索好学网,或加公众号 haoxueecom 获取更多学习资讯!      

赞一个
(0)
0%
嘘一下
(0)
0%
------分隔线----------------------------