控制面板 | 帮助中心 | 有问必答 | 会员专区 | 付款方式 | 联系我们 | 开通400电话 | 启达网络
注册会员 忘记密码
VPS怎么通过伪静态组件设置301? 更多内容,请登录会员查看
网站动态

首页 >> 本站通知 >> VPS怎么通过伪静态组件设置301?

VPS怎么通过伪静态组件设置301?

分享到:

1、首先需要为服务器配置好伪静态(Windows:ISAPI_Rewrite,Linux:mod_rewrite)

2、上传伪静态规则到站点根目录下就可以了。

httpd.ini

[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteCond Host: ^domain\.com$
RewriteRule (.*) http\://www\.domain\.com$1 [RP,I]

.htaccess

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