S
S
Sergey2014-07-05 17:33:11
Yii
Sergey, 2014-07-05 17:33:11

How to connect a subdomain for statics in Yii2?

I want to move css, js to a separate subdomain, on which I will hang nginx. In .htaccess (at the root of the main application) I will indicate that everything in css, js is redirected to site.ru/static
How to transfer folders to a static subdomain?
Should I somehow override baseurl and basePath in frontend AppAssets?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LAV45, 2014-07-06
@TsarS

config/main.php

return [
  'components' => [
    'assetManager' => [
      'baseUrl' => 'http://src.site.my',
    ],
  ],
];

At the exit
<script src="http://src.site.my/22478422/jquery.min.js"></script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question