閱讀141 返回首頁    go 萬網互聯


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 ^(.*)$ https://www.domain.com/$1 [L,R=301]

 

最後更新:2017-01-12 21:14:00

  上一篇:go 解決備案被退回或審核時間過長的一些方法
  下一篇:go 新網空間備案常見問題和注意事項