LoginSignup
1
0

More than 5 years have passed since last update.

.htaccessのいろいろ

Last updated at Posted at 2017-03-09

前提条件:
サイトrootに .htaccessファイルを作成 *権限注意
まだ、
.httpdにて編集したいDirectoryにて
AllowOverrideをAllにする *必要に応じてAllは他のもっと細かい設定にできる

HTTPをHTTPSにリダイレクトする

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

URLの後ろにindex.*を消す

RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)index.html$ https://<domain>.com/$1 [R=301,L]
1
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
1
0