Options +FollowSymlinks
RewriteEngine On

# deal with admin first
RewriteCond %{REQUEST_URI} /(admin)
RewriteRule ^admin/assets/(.*)$ admin/web/assets/$1 [L]
RewriteRule ^admin/css/(.*)$ admin/web/css/$1 [L]
RewriteRule ^admin/font/(.*)$ admin/web/font/$1 [L]
RewriteRule ^admin/plugins/(.*)$ admin/web/plugins/$1 [L]
RewriteRule ^admin/images/(.*)$ admin/web/images/$1 [L]
RewriteRule ^admin/img/(.*)$ admin/web/img/$1 [L]
RewriteRule ^admin/js/(.*)$ admin/web/js/$1 [L]

RewriteCond %{REQUEST_URI} !/admin/web/(assets|css|font|plugins|images|img|js)/
RewriteCond %{REQUEST_URI} /(admin)
RewriteRule ^.*$ admin/web/index.php [L]


RewriteCond %{REQUEST_URI} /(assets|css|js|img|fonts|uploads)
RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L]
RewriteRule ^sitemap/(.*)$ frontend/web/sitemap/$1 [L]
RewriteRule ^css/(.*)$ frontend/web/css/$1 [L]
RewriteRule ^js/(.*)$ frontend/web/js/$1 [L]
RewriteRule ^img/(.*)$ frontend/web/img/$1 [L]
RewriteRule ^fonts/(.*)$ frontend/web/fonts/$1 [L]
#RewriteRule ^uploads/(.*)$ frontend/web/uploads/$1 [L]
RewriteRule ^uploads/(.*)$ uploads/$1 [L]

RewriteCond %{REQUEST_URI} !/(frontend|admin)/web/(assets|sitemap|css|js|img|images|fonts|uploads|plugins|font)/
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ frontend/web/index.php

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
