.htaccess settings for subdomain

Hi! I made mobile version on subdomain.

My .htaccess




<IfModule mod_rewrite.c>

    # 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

</IfModule>



But, assets, css, js not work.

I don’t understand how setting assets, css, js in .htaccess for subdomain.

I feel making two themes instead of two domains this will be easier to manage. You can set the theme in session and tell the config to use the mobile version from session if it’s set. Since you already have the mobile version made you can just convert it to a theme in a few minutes.