-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
33 lines (26 loc) · 1.2 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
Options +FollowSymlinks
RewriteEngine On
Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?localhost.*$ [NC]
RewriteRule \.(gif|jpg|png|js|css)$ - [F]
ErrorDocument 403 http://localhost/404.html
ErrorDocument 404 http://localhost/404.html
# deal with admin first
RewriteCond %{REQUEST_URI} ^/yii2-advanced-quickstart/(admin)
RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]
RewriteCond %{REQUEST_URI} !^/yii2-advanced-quickstart/backend/web/(assets|css)/
RewriteCond %{REQUEST_URI} ^/yii2-advanced-quickstart/(admin)
RewriteRule ^.*$ backend/web/index.php [L]
RewriteCond %{REQUEST_URI} ^/yii2-advanced-quickstart/(assets|css)
RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
RewriteRule ^css/(.*)$ frontend/web/css/$1 [L]
RewriteRule ^js/(.*)$ frontend/web/js/$1 [L]
RewriteRule ^images/(.*)$ frontend/web/images/$1 [L]
RewriteCond %{REQUEST_URI} !^/yii2-advanced-quickstart/(frontend|backend)/web/(assets|css)/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ frontend/web/index.php