2010-09-23 114 views

回答

0

請確保您有mod_rewrite的安裝,這應該爲你工作:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] 

如果你想爲某些子域做:

RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteCond %{HTTP_HOST} ^(sub1|sub2|sub3)\. [NC] 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L] 
相關問題