0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

さくらインターネットのレンタルサーバでSSL通信を使う

Posted at

さくらインターネットのレンタルサーバで共有SSL(https)通信を使う方法メモ。

サーバコントロールパネルを開いて左のナビゲーションの「ドメイン設定」から
SSLを使用したいドメイン名の「変更」ボタン>「共有SSLを利用する」にチェックを入れて「送信」

すべてのアクセスをSSL(https)通信にさせる。
テキストエディタで下記ファイルを作成し、トップディレクトリに配置。

.htaccess
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # http to https
    RewriteCond %{ENV:HTTPS} !^on$
    RewriteCond %{HTTP:X-Sakura-Forwarded-For} ^$
    RewriteRule .* https://gunmetal.sakura.ne.jp%{REQUEST_URI} [R=301,L]
</IfModule>
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?