2015-12-21 52 views
1

我得到了用戶身份驗證,以處理我正在處理的一個小項目。但是,防火牆後面的所有頁面都無法訪問我的資產文件夾。所以它沒有CSS,也不會在該文件樹中獲取圖像。讓您的資產通過防火牆連接,Silex

$app->register(new Silex\Provider\SecurityServiceProvider(), array(
$app['security.firewalls'] = array(
    'user' => array(
     'pattern' => '^/user', 
     'form' => array(
      'login_path' => '/', 
      'check_path' => '/user/login_check', 
      'default_target_path' => '/user/user_area', 
      'always_use_default_target_path' => true 
     ), 
     'users' => array(
      'user' => array('ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='), 
     ), 
    ), 
), 

));

和我的CSS文件在樹枝

<link href="assets/css/bootstrap.css" rel="stylesheet"> 
<!--external css--> 
<link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" /> 

<!-- Custom styles for this template --> 
<link href="assets/css/style.css" rel="stylesheet"> 
<link href="assets/css/style-responsive.css" rel="stylesheet"> 
<link href="assets/css/scout-styles.css"> 

樣本和我的.htaccess

<IfModule mod_rewrite.c> 
Options -MultiViews 

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.php [QSA,L] 

+0

我注意到資產現在被路由爲''試圖製作一個用戶文件來放置我的資產,但是這樣會擾亂路由。 –

+0

你可以發佈你的.htaccess文件(或你的重定向規則)嗎? – mTorres

+0

這是我的全部,我需要了解的.htaccess' 選項-MultiViews RewriteEngine敘述在 的RewriteCond%{} REQUEST_FILENAME!-f 重寫規則^的index.php [QSA,L] ' –

回答

0

讓我們關閉這一個。

看來問題出在資產的URI路徑中,他們只需要以/字符開頭,以使路徑絕對不是當前URI路徑。