This repository has been archived by the owner on Jun 25, 2018. It is now read-only.
/
.htaccess
49 lines (40 loc) · 1.74 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
Options FollowSymLinks
AddDefaultCharset utf-8
php_value error_reporting 'E_ALL & ~E_NOTICE'
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect to /city/
RewriteCond %{REQUEST_URI} ^/city/$ [OR]
RewriteCond %{REQUEST_URI} ^/city$
RewriteRule . /community/? [R=301,L]
# the main rewrite rule for the frontend application
RewriteCond %{REQUEST_URI} !^/(backend/web|control|ico)
RewriteRule !^frontend/web /frontend/web%{REQUEST_URI} [L]
# redirect to the page without a trailing slash (uncomment if necessary)
#RewriteCond %{REQUEST_URI} ^/control/$
#RewriteRule ^(control)/ /$1 [L,R=301]
# the main rewrite rule for the backend application
RewriteCond %{REQUEST_URI} ^/control
RewriteRule ^control(.*) /backend/web/$1 [L]
RewriteCond %{REQUEST_URI} ^/ico
RewriteRule ^ico(.*) /frontend/web/ico/$1 [L]
# if a directory or a file of the frontend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php [L]
# if a directory or a file of the backend application exists, use the request directly
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php [L]
RewriteCond %{REQUEST_URI} \.(htaccess|htpasswd|svn|git)
RewriteRule \.(htaccess|htpasswd|svn|git) - [F]
</IfModule>