在 ubuntu 8.04 以及 apache2 的環境為例,而且 apache2 的 rewrite 模組也開啓了。

只要編寫在該網站目錄中的 .htaccess 即可,範例如下:
RewriteEngine on
RewriteBase /var/www/test
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/test/$1 [L,R]

紅字的部份要依你自己的環境來設定。

參考來源:
http://phorum.study-area.org/index.php?topic=23778.0
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
arrow
arrow
    全站熱搜

    tern 發表在 痞客邦 留言(0) 人氣()