bestlong 怕失憶論壇

 

 

搜索
bestlong 怕失憶論壇 論壇 MIS 讓 http 網址自動轉址 https
查看: 4295|回復: 0
go

讓 http 網址自動轉址 https [複製鏈接]

Rank: 9Rank: 9Rank: 9

1#
發表於 2010-10-30 12:53 |只看該作者 |倒序瀏覽 |打印
資料參考 http://a-wei.net/archives/288

使用 mod_rewrite 模組, 讓 apache 自動的從 http 非加密連線,轉址到 https 的加密連線.

修改 httpd.conf 設定檔

一、整個網站轉移
在 VirtualServer 內的 Directory

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]

二、某個目錄做自動轉移

在該目錄內

RewriteEngine on
RewriteBase /folder
RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^(.*)?$ https://%{SERVER_NAME}/$1 [L,R]
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

這樣就會自動轉移了, 另外寫在網站目錄內的 .htaccess 也是可以的.
我是雪龍
http://blog.bestlong.idv.tw
http://www.bestlong.idv.tw
‹ 上一主題|下一主題

Archiver|怕失憶論壇

GMT+8, 2024-5-4 15:12 , Processed in 0.009982 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.