'Why css files working in local laravel but not in heroku?
I have Laravel app.
I am referencing a CSS file.
The file is inside a public folder, css app.
it is working fine locally when deploying to heroku, it says 404.
web: vendor/bin/heroku-php-apache2 public/
and my .htcsss
is
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/index.php?$1 [END,QSA]
</IfModule>
both in the root and under public folder.
I am loading my asset
<link href="{{ secure_asset('/css/app/shopex.css') }}" rel="stylesheet">
<link href="{{secure_asset('css/app/shopex.css')}}" rel="stylesheet">
<link rel="stylesheet" href="{{secure_asset('css/app/shopex.css')}}" />
<link rel="stylesheet" href="{{secure_asset('/css/app/shopex.css')}}" />
<link rel="stylesheet" href="{{secure_asset('public/css/app/shopex.css')}}" />
<link rel="stylesheet" href="{{secure_asset('/public/css/app/shopex.css')}}" />
<link rel="stylesheet" href="public/css/app/shopex.css" />
<link rel="stylesheet" href="/public/css/app/shopex.css" />
<link rel="stylesheet" href="{{asset('css/app/shopex.css')}}" />
<link rel="stylesheet" href="{{asset('/css/app/shopex.css')}}" />
<link rel="stylesheet" href="{{asset('public/css/app/shopex.css')}}" />
<link rel="stylesheet" href="{{asset('/public/css/app/shopex.css')}}" />
Solution 1:[1]
Hi try to remove first backslash from 'css/app/shopex.css' and check the ssl sertificate still alive on your heroku becouse secure_asset use The secure_asset function generates a URL for an asset using HTTPS. Try to use asset becouse The asset function generates a URL for an asset using the current scheme of the request (HTTP or HTTPS):
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Solomon Space |
