LoginSignup
12
10

More than 5 years have passed since last update.

.htaccessで全てのページのアクセス(SSLありなし)をトップページにリダイレクトする設定

Last updated at Posted at 2015-12-13
RewriteEngine On

RewriteBase /

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/index.html$
RewriteCond %{REQUEST_URI} !^.*\.(gif|jpg|jpeg|png|swf|css|js)$ [NC]
RewriteRule ^(.*)$ http://exmaple.com/index.html [L,R]

RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ http://exmaple.com/index.html [L,R]

どのページへのアクセスも、HTTP/HTTPS問わず「http://exmaple.com/index.html 」にリダイレクトされます。

12
10
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
12
10