首页 > Apache > Apache副域名自动跳转到主域名的.htaccess脚本

Apache副域名自动跳转到主域名的.htaccess脚本

# 副域名自动跳转到主域名
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?副域名1\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?副域名2\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?副域名3\.com [NC,OR]
.
.
.
RewriteRule (.*) http://主域名.com/$1 [R=301,L]
# END 副域名自动跳转到主域名

分类:Apache 标签:, , ,
  1. 还没有评论。
  1. No trackbacks yet.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: