-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
40 lines (31 loc) · 1.19 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
AddDefaultCharset UTF-8
# Options
Options -Indexes -Multiviews
# HTTP errors
ErrorDocument 400 /index.php?_req=/errors/400/
ErrorDocument 401 /index.php?_req=/errors/401/
ErrorDocument 403 /index.php?_req=/errors/403/
ErrorDocument 404 /index.php?_req=/errors/404/
ErrorDocument 500 /index.php?_req=/errors/500/
# Enable URI rewriting
RewriteEngine on
RewriteBase /
# Remove www.
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1%{REQUEST_URI} [L,QSA,R=301,NC]
# Redirect to https://
#RewriteCond %{HTTPS} off
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,QSA,R=301]
# Add a slash to the end of the uri
RewriteCond %{REQUEST_URI} !\.([a-zA-Z0-9]{2,5})$
RewriteRule ^.*[^/]$ /$0/ [L,R]
# Give direct access to "phrapp/resource/"
RewriteCond %{DOCUMENT_ROOT}/phrapp/resources%{REQUEST_URI} -f
RewriteRule ^(.*)$ /phrapp/resources%{REQUEST_URI} [L,QSA,NC]
# Give diretc access to "default/resource/"
RewriteCond %{REQUEST_URI} ^/phramer/.*$ [NC]
RewriteRule ^phramer\/(.*)$ /phrame/default/resources/$1 [L,QSA]
# Give direct access to existing files
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^(.*)$ index.php [QSA,L]