-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy path.htaccess
82 lines (58 loc) · 2.98 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# HOW TO USE THIS FILE?
#
# 1. After uploading all files to the server, renam this file on the server
# to ".htaccess" (excluding the quotes).
#
# 2. Modify the .htaccess file if you have installed berta in a subfolder
# on your server (e.g., not www.mysite.net, but www.mysite.net/berta).
# Scroll down to look for the places marked by asterisks (***).
#
# 3. Test, if your site works, by opening it in your browser. If you receive
# Server Error 500, then your server has problems parsing this file. Contact
# your hosting service and ask them to "allow mod_rewrite in .htaccess files".
#
# Disable directory listing
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
# CHANGABLE PART - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \
# *** Change the "/" to the name of the folder where you uploaded berta.
# E.g.: "/berta/" (without quotes), if you uploaded berta to the
# subfolder berta of the www root of your web server.
RewriteBase /
# *** In the following RewriteCond statements, change the part "^/" to include
# the name of the foler you uploaded berta to.
# E.g.: "^/berta/" (without quotes), if you uploaded berta to the
# subfolder berta of the www root of your web server.
RewriteCond %{REQUEST_URI} !^(.*)/$
RewriteRule engine/hosting$ - [F,L]
# Make all index links go to angular app
# @todo: remove this when we move angular app directly in engine folder
RewriteCond %{REQUEST_URI} /engine/index\.php$
RewriteRule .* /engine/dist/index.html [L]
RewriteCond %{REQUEST_URI} ^/engine.*
RewriteCond %{REQUEST_URI} !^/engine/editor.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /engine/dist/index.html [L]
RewriteCond %{REQUEST_URI} ^/storage.*\.(xml|sqlite|db|log|php)$ [OR]
RewriteCond %{REQUEST_URI} ^/storage/$ [OR]
RewriteCond %{REQUEST_URI} ^/_templates/$
RewriteRule ^ - [R=404,L]
# If you have folders or files inside berta's folder you wish to access directly,
# then modify and uncomment the following line
# RewriteCond %{REQUEST_URI} ^/(my_folder_name1|my_folder_name1|my_file.html).*$ [OR]
RewriteCond %{REQUEST_URI} ^/(.well-known|_plugin_shop|engine|INSTALL|storage|_templates|_themes).*$ [OR]
RewriteCond %{REQUEST_URI} ^/(index\.php|sitemap\.xml\.php|robots\.txt|crossdomain\.xml|favicon\.ico).*$
RewriteRule .* - [L]
# END OF CHANGABLE PART - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \
# DON'T CHANGE ANYTHING HERE!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !index.php$
RewriteCond %{REQUEST_URI} !^(.*)/$
RewriteRule ^(.*)$ /$1/ [R=301,L]
# the content is fed to index.php, which handles it
RewriteRule ^.*$ index.php?__rewrite=1 [QSA]
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /
</IfModule>