论坛

 找回密码
 注册
                  
查看: 1838|回复: 4

mywanbo.com~传个你的.htaccess文件301重定向自动添加www给我

[复制链接]
发表于 2010-3-23 05:40 | 显示全部楼层 |阅读模式
代码我不熟悉
发表于 2010-3-23 06:38 | 显示全部楼层
倒。加www.和去掉www.我知道的啊。
 楼主| 发表于 2010-3-23 16:52 | 显示全部楼层
怎么设置啊?
发表于 2010-3-23 21:10 | 显示全部楼层
Redirect users to access the site without www:

# To redirect all users to access the site WITHOUT the www. prefix,
# (http://www.example.com/... will be redirected to http://example.com/...)
# adapt and uncomment the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]


Redirect users to use www:

# To redirect all users to access the site WITH the www. prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
 楼主| 发表于 2010-3-23 21:12 | 显示全部楼层
全部放到.htaccess文件里吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则



小黑屋|手机版|Archiver|论坛

GMT+8, 2024-12-21 17:20 , Processed in 0.065096 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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