2016-11-02 72 views

回答

0

取得了.htaccess文件的一些變化和問題解決了。

Options +FollowSymlinks 
RewriteEngine On 

# deal with admin first 
RewriteCond %{REQUEST_URI} ^/advanced/(admin) 
RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L] 
RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L] 
RewriteRule ^admin/uploads/(.*)$ backend/web/uploads/$1 [L] 

RewriteCond %{REQUEST_URI} !^/advanced/backend/web/(assets|css|uploads)/ 
RewriteCond %{REQUEST_URI} ^/advanced/(admin) 
RewriteRule ^.*$ backend/web/index.php [L] 


RewriteCond %{REQUEST_URI} ^/advanced/(assets|css) 
RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L] 
RewriteRule ^css/(.*)$ frontend/web/css/$1 [L] 

RewriteCond %{REQUEST_URI} !^/advanced/(frontend|backend)/web/(assets|css|uploads)/ 
RewriteCond %{REQUEST_URI} !index.php 
RewriteCond %{REQUEST_FILENAME} !-f [OR] 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^.*$ frontend/web/index.php 
2

刪除/網絡

<?= Html::img(Yii::getAlias('@web').'/uploads/'.$model->logo, ['alt'=>'some', 'class'=>'thing']);?> 
+0

不工作,仍然給404 –

+0

你上傳你的文件? –

+0

以及如何從服務器訪問您的後端,在後端/ web/uploads /中使用yii serve或http:// localhost/project/backend/web –

0

可能是相對路徑

<?= Html::img(Yii::getAlias('@web'). '.'. 
     DIRECTORY_SEPARATOR . 'uploads' .DIRECTORY_SEPARATOR .$model->logo, 
     ['alt'=>'some', 'class'=>'thing']);?>