Answer the question
In order to leave comments, you need to log in
After transferring to the server, a site on yii2, assets font-awesome gives a 403 error?
Font-awesome I installed via composer by adding this line to composer.json:
"require": {
...
"FortAwesome/Font-Awesome": "4.7.0",
...
}
<?php
namespace backend\assets;
use yii\web\AssetBundle;
class FontAwesomeAsset extends AssetBundle
{
public $sourcePath = '@vendor/fortawesome/font-awesome';
public $css = [
'css/font-awesome.css'
];
}
Answer the question
In order to leave comments, you need to log in
Thanks everyone, problem solved!
The problem was in the domain config:
<Directory /var/www/virtual/domen.my>
Options +SymLinksIfOwnerMatch
Require all granted
</Directory>
<Directory /var/www/virtual/domen.my>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Check the existence of the file on the server at this address, then check the access to the files via a direct link. Most likely, the server will return a 403 response code via a direct link. If so, then you need to look at the server configs, namely the return of static files
Maybe so?
or so?
public $sourcePath = '@vendor/bower/fortawesome/font-awesome';
When transferring a project to another server, as a rule, there are problems in the rights
. Look for the rights to be set in the web/assets folder
.
Command result ls -la
from folder web
to studio
One line at a time, you should get errors in the runtime, cache folders
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question