Answer the question
In order to leave comments, you need to log in
How to setup .htaccess in YII2 for subdomain?
Hey! Set up .htaccess for subdomain
# Backend redirect
RewriteCond %{REQUEST_URI} ^/backend
RewriteRule ^backend/(.*)$ backend/web/$1 [L]
# Statics redirect
RewriteCond %{REQUEST_URI} ^/statics
RewriteRule ^statics/(. *)$ statics/web/$1 [L]
# Frontend redirect
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule ^(.*)$ frontend/web/$1
# Mobile redirect
RewriteCond %{HTTP_HOST} ^m\.site \.ru$
RewriteRule ^(.*)$ mobile/web/$1
When entering m.site.ru everything works, index.php and settings are taken from where it should be, BUT, assets, css, js does not work.
Please tell me how to set up .htaccess for assets, css, js for a subdomain.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question