-
Notifications
You must be signed in to change notification settings - Fork 2
/
.htaccess
49 lines (41 loc) · 1.88 KB
/
.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# htaccess file
#
# @package Apiopenstudio
# @license This Source Code Form is subject to the terms of the ApiOpenStudio Public License.
# If a copy of the license was not distributed with this file,
# You can obtain one at https://www.apiopenstudio.com/license/.
# @author john89 (https://gitlab.com/john89)
# @copyright 2020-2030 Naala Pty Ltd
# @link https://www.apiopenstudio.com
# Don't show directory listings for URLs which map to a directory.
Options -Indexes
# Follow symbolic links in this directory.
Options +FollowSymLinks
# Set the default handler.
DirectoryIndex index.php index.html index.htm
# Allow cross domain policy
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "origin, x-requested-with, content-type"
# Limit HTTP methods to PUT, GET, POST, DELETE and OPTIONS
Header set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
<IfModule mod_rewrite.c>
RewriteEngine On
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or
# Git to store control files. Files whose names begin with a period, as well
# as the control files used by CVS, are protected by the FilesMatch directive
# above.
#
# NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
# not possible to block access to entire directories from .htaccess, because
# <DirectoryMatch> is not allowed here.
#
# If you do not have mod_rewrite installed, you should remove these
# directories from your webroot or otherwise protect them from being
# downloaded.
RewriteRule "(^|/)\." - [F]
# Rewrite rule for all coorrect requests to the API
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9\/\-_\%\.]*)$ /public/index.php?request=$1 [QSA,NC,L]
</IfModule>