301规则httpd.ini

2014-09-03 23:44:04 3266

D自己今天动手写了一遍设置301的规则,现在与童鞋们进行分享

可以根据您的需要,将代码加入到httpd.ini文件中:

1
、将单个域名a.com重定向到其他空间的b.com
[ISAPI_Rewrite]
RewriteCond Host: ^(?:www.)?a.com$
RewriteRule ^/(.*)$ http://www.landui.com/$1 [L,RP]

2、将多个域名a.org b.org 重定向到其他空间的www.landui.com
[ISAPI_Rewrite]
RewriteCond Host: ^(?:www.)?(?:a.org|a.org)$
RewriteRule ^/(.*)$ http://www.landui.com/$1 [L,RP]

3、不带www域名landui.com重定向到带www域名www.landui.com

[ISAPI_Rewrite]
RewriteCond Host: ^landui.cn$
RewriteRule ^/(.*)$ http://www.landui.com/$1 [L,RP]

提交成功!非常感谢您的反馈,我们会继续努力做到更好!

这条文档是否有帮助解决问题?

非常抱歉未能帮助到您。为了给您提供更好的服务,我们很需要您进一步的反馈信息:

在文档使用中是否遇到以下问题: