D
D
DragonChris2017-09-01 09:43:52
css
DragonChris, 2017-09-01 09:43:52

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",
    ...
}

Created assets
<?php

namespace backend\assets;

use yii\web\AssetBundle;

class FontAwesomeAsset extends AssetBundle
{

 public $sourcePath = '@vendor/fortawesome/font-awesome';
 public $css = [
 'css/font-awesome.css'
 ];
}

But after transferring to the server, it gives an error: Failed to load resource: the server responded with a status of 403 (Forbidden) and the icons are not loaded.
path to the file: domen/assets/ad9c0b16/css/font-awesome.css
I even tried setting permissions to 777 - it doesn't help.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DragonChris, 2017-09-01
@DragonChris

Thanks everyone, problem solved!
The problem was in the domain config:

<Directory /var/www/virtual/domen.my>
    Options +SymLinksIfOwnerMatch
    Require all granted  
</Directory>

Changed to :
<Directory /var/www/virtual/domen.my>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

E
Evgeny Bukharev, 2017-09-01
@evgenybuckharev

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

I
Ilya Beloborodov, 2017-09-01
@kowap

Maybe so?
or so?

public $sourcePath = '@vendor/bower/fortawesome/font-awesome';

M
Maxim Fedorov, 2017-09-01
@Maksclub

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 -lafrom folder webto 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 question

Ask a Question

731 491 924 answers to any question