V
V
Viktor Yanyshev2017-03-02 22:31:31
Yii
Viktor Yanyshev, 2017-03-02 22:31:31

Why are yii2 scripts not loading correctly after installation?

After installing via composer

composer create-project --prefer-dist yiisoft/yii2-app-basic basic
and go to the host address, CSS, JS is not loaded. In general, there is no default design (I suspect that there will be problems later). It looks like this:
b72cf24a99144971838119ee0f41a637.jpg
If you look at what the error refers to in the console, you can see that there is not JS or CSS, but HTML:
801ff9eda2614d879152945217adc6a4.jpg
This problem is on MacOS, php 7.0.15, Apache. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Yanyshev, 2017-03-03
@villiwalla

padlyuck : slo_nik : Stasgar : Thanks, this config helped:

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [L]
RewriteRule ^.*$ index.php [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question