LoginSignup
0
0

More than 3 years have passed since last update.

http から https にリダイレクトさせる方法

Last updated at Posted at 2019-11-22

設置した経緯

http でアクセスした場合に、一部の機能がエラーになるので https にリダイレクトさせたい!

.htaccessファイルを作成

RewriteEngine on
RewriteCond %{ HTTPS } off
RewriteRule ^(.*)$ https://%{ HTTP_HOST }%{ REQUEST_URI } [R=301,L]

設置する場所

ファイル全体に反映したい場合は、ドメインルートに設定する。
階層ごとにファイルを設置した場合は、その階層のファイルの設定が優先されます。

htaccess_01.png

htaccess_02.png

0
0
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
0