forked from sunlight-cms/sunlight-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
29 lines (24 loc) · 797 Bytes
/
.htaccess
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
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
# redirect to HTTPS
#RewriteCond %{HTTPS} off
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# determine RewriteBase and set it into env
RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
RewriteRule .* - [E=BASE:%1]
# direct requests to index.php unless it's a file or a dir
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>
# deny access to composer and hidden files
<FilesMatch "^composer\.(json|lock)$|^\.">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</FilesMatch>