找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 2959|回复: 0

[网站] 一些301的重定向规则

[复制链接]
惘城落遇 发表于 2012-1-9 09:48:20 | 显示全部楼层 |阅读模式
IIS 6.0 rewrite 3
  1. # For ISAPI_Rewrite 3.x
  2. RewriteCond %{HTTP:Host} ^chenyu\.me$
  3. RewriteRule (.*) http\://www\.chenyu\.me/$1 [NC,R=301]
复制代码
或:下面的规则是所有二级域名前面都会加上www,如bbs.chenyu.me,它也会加www,变成www.chenyu.me
  1. # For ISAPI_Rewrite 3.x
  2. RewriteCond %{HTTPS} (on)?
  3. RewriteCond %{HTTP:Host} ^(?!www\.)(chenyu\.me)$ [NC]
  4. RewriteCond %{REQUEST_URI} (.+)
  5. RewriteRule .? http(?%1s)://www.%2%3 [R=301,L]
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表