1
When I run my local application, the styles and js are loaded normally. The css and js are in public/css and public/js.
In production they are not loaded, below the production . htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /ambiente
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Code from app.blade.php
<!-- Styles -->
<link href="/css/app.css" rel="stylesheet">
<!-- Scripts -->
<script src="/js/app.js"></script>
What am I doing wrong?
Your production configuration is not correct, you use shared hosting?
– novic
Yes, I use but I use another application also in Laravel that works well. I copied the . htaccess of the application that works and nothing
– Marcelo Gomes
This is the big problem Shared Hosting, the settings never work out, because, the configuration of Laravel is kind of particular even if it has worked out in some other is a mistake to make these settings. Complicated.
– novic
Virgilio, do you have any accommodation suggestions where I could host my Laravel projects?
– Marcelo Gomes
https://www.heroku.com/
– novic
But you can create subdominios or domains in Heroku?
– Marcelo Gomes
http://hoo.st/pt-br
– novic
has yes @Marcelogomes
– novic
Virgilio, I’m staying at hoo.st/en. this is the problem.
– Marcelo Gomes
Eita indicated me this little bit on the site Laravel-br.slack.com
– novic
@Marcelogommes told me this https://forge.laravel.com/ it can be reconciled with Digital Ocean
– novic
https://www.digitalocean.com/? refcode=619e33cb5d72&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=CopyPaste
– novic
Marcelo try the following in the html that imports these resources, I assume it is Blade:
<link href="{{url('/css/app.css')}}" rel="stylesheet">
and<script src="{{url('/js/app.js')}}"></script>
– Miguel
I created an environment variable . env to control 'public' or 'no' folders and it worked with '{{{ url() }}'. Thanks
– Marcelo Gomes
@Marcelogomes sorry to intrude on the conversation... rs but the problem is here Rewritebase /environment your system is in this folder? If you manage to put your entire system in this folder "/ambience" and set up your apache nigx with your system’s domain to point to "/environment/public", I think you’ll have solved your problem there, no?
– Evert
@Marcelogomes only as an option, if you want to opt for a VPS, I really like the AWS of Amazon and OVH, the latter can be a good, cheap start. If you need less latency, you will have to look for something in Brazil. http://ovh.ca
– Evert