在laravel 5.1 app

时间:2015-09-26 18:40:11

标签: php css .htaccess laravel laravel-5.1

我使用scotchbox并将我的应用程序设置为:

app-response-tracker/
  AppResponseTracker/
    app/
    ...
    public/
      css/
        app.css
      js/
        all.js
    resources/
      assets/
      views/
    ...
  public/
    .htaccess/
    favicon.ico
    index.php
    robots.txt

在我的layouts.main中我有以下html:

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="App Response Tracker allows you to track the response of applications
    and monitor error output by connecting to a secure end point.">
    <meta name="author" content="Adam Balan">

    <link rel="icon" href="../../favicon.ico">

    <title>App Response Tracker</title>

    <link href="{{asset('css/app.css')}}" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

您关注的问题是:<link href="{{asset('css/app.css')}}" rel="stylesheet">

在Chrome中,这也解决了:http://app-response-tracker.com/css/app.css

根据docs

  

资产

     

生成资产的网址。

     

$ url = asset(&#39; img / photo.jpg&#39;);

我的htaccess文件如下:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

网站加载正常,风格根本不加载。我该如何解决这个问题?

0 个答案:

没有答案