forked from EC-CUBE/ec-cube3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess.sample
51 lines (42 loc) · 1.45 KB
/
.htaccess.sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
DirectoryIndex index.php index.html .ht
<FilesMatch "^composer|^autoload|^cli-config|^COPYING|\.(ini|lock|dist|git|sh|bak|swp)$">
order allow,deny
deny from all
</FilesMatch>
<Files ~ "index.php|index_dev.php">
order deny,allow
allow from all
</Files>
<IfModule mod_headers.c>
# クリックジャッキング対策
Header always set X-Frame-Options SAMEORIGIN
# XSS対策
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options nosniff
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# Authorization ヘッダが取得できない環境への対応
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
# さくらのレンタルサーバでサイトへのアクセスをSSL経由に制限する場合の対応
# RewriteCond %{HTTP:x-sakura-forwarded-for} !^$
# RewriteRule ^(.*) - [E=HTTPS:on]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^(.*)\.(gif|png|jpe?g|css|ico|js|svg)$ [NC]
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
# 管理画面へのBasic認証サンプル
#
# Satisfy Any
#
# AuthType Basic
# AuthName "Please enter username and password"
# AuthUserFile /path/to/.htpasswd
# AuthGroupFile /dev/null
# require valid-user
#
# SetEnvIf Request_URI "^/admin" admin_path # ^/adminは, 管理画面URLに応じて変更してください
# Order Allow,Deny
# Allow from all
# Deny from env=admin_path