虚拟主机可以建几个站点?
回 1楼魔咒626的帖子
ECS没用过啊,我小白,不懂哦
-------------------------
Re虚拟主机可以建几个站点?
搞定了,参考链接
https://yq.aliyun.com/articles/225402
代码:
#一对一绑定域名方法
RewriteEngine On
RewriteBase /
# 绑定www.blooo.cn 到子目录bloo
RewriteCond %{HTTP_HOST} ^blooo\.cn$ [NC]
RewriteCond %{REQUEST_URI} !^/blmo/
RewriteRule ^(.*)$ blmo/$1?Rewrite [L,QSA]
# 绑定www.blooo.cn 到子目录blmo
RewriteCond %{HTTP_HOST} ^www\.blooo\.cn$ [NC]
RewriteCond %{REQUEST_URI} !^/blmo/
RewriteRule ^(.*)$ blmo/$1?Rewrite [L,QSA]
# 绑定music.blooo.cn 到子目录blmu
RewriteCond %{HTTP_HOST} ^music\.blooo\.cn$ [NC]
RewriteCond %{REQUEST_URI} !^/blmu/
RewriteRule ^(.*)$ blmu/$1?Rewrite [L,QSA]
# 绑定www.zhoujiahua.cn 到子目录jiahua
RewriteCond %{HTTP_HOST} ^zhoujiahua\.cn$ [NC]
RewriteCond %{REQUEST_URI} !^/jiahua/
RewriteRule ^(.*)$ jiahua/$1?Rewrite [L,QSA]
RewriteCond %{HTTP_HOST} ^www\.zhoujiahua\.cn$ [NC]
RewriteCond %{REQUEST_URI} !^/jiahua/
RewriteRule ^(.*)$ jiahua/$1?Rewrite [L,QSA]
#可以绑定多个, 只需重复上三行代码并更改一下域名、目录名 就OK了
赞0
踩0