-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
31 lines (24 loc) · 961 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
30
31
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
## Redirect www to non www
# RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
## Redirect unsecure to secure
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# For existing folders, rewrite only access to cli file, app, components, core and tests folders
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule !^(app|components|core|tests)($|/) - [L]
RewriteRule ^cli index.php [L]
## Rewrite the rest to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^ index.php [L]
</IfModule>