forked from hm-tam/spr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample.htaccess
44 lines (35 loc) · 1.51 KB
/
sample.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
# Turn on the Rewrite Engine
RewriteEngine On
# ------------------------------------------------------------------------------
# RewriteBase
# ------------------------------------------------------------------------------
# Ensure this matches your _site_root
RewriteBase /
# ------------------------------------------------------------------------------
# Protect System Files
# ------------------------------------------------------------------------------
RewriteRule ^_app - [F,L]
RewriteRule ^_config - [F,L]
RewriteRule ^_cache - [F,L]
RewriteRule ^_content - [F,L]
RewriteRule ^_logs - [F,L]
RewriteRule ^_storage - [F,L]
RewriteRule ^admin/themes/[^/]*/(?:layouts|templates) - [F,L]
RewriteRule ^.*?\.yml$ - [F,L]
RewriteRule ^.*?\.yaml$ - [F,L]
RewriteRule ^.*/?\.git+ - [F,L]
# This will prevent all .html files from being accessed.
# You may want to remove this line if you want to serve
# static files outside of Statamic
# RewriteRule ^(.*)?\.html$ - [F,L]
# ------------------------------------------------------------------------------
# Remove Trailing Slashes from URL
# ------------------------------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L]
# ------------------------------------------------------------------------------
# Remove the Index File
# ------------------------------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]