將yedward.net(裸域)永久重定向至www.yedward.net,統一權重、避免重複收錄、利於SEO。
前提:主機商支援mod_rewrite與.htaccess覆蓋。
# 根目錄 .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yedward\.net [NC]
RewriteRule ^(.*)$ https://www.yedward.net/$1 [R=301,L]
若無.htaccess,本地建立htaccess.txt上傳後改名。
前提:主機商安裝ISAPI_Rewrite(收費組件,部分商家預裝)。
# 根目錄 httpd.ini
[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteCond Host: ^yedward\.net$
RewriteRule (.*) https://www.yedward.net$1 [I,RP]
RewriteCond Host: ^seo\.yedward\.net$
RewriteRule (.*) https://www.yedward.net$1 [I,RP]
同理:無檔案時建httpd.txt上傳改名。
https://www.yedward.net。



www版本。https://www.yedward.net/...。www版本。文章來源:yedward.net