Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku 403 Forbidden for static js files

I have push my simple php app to Heroku and get 403 status for some js files.

https://guarded-forest-7267.herokuapp.com/vendor/jquery/dist/jquery.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-form/jquery.form.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-validate/dist/jquery.validate.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery.inputmask/dist/inputmask/jquery.inputmask.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/modernizer/modernizr.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jselector/src/jquery.jselector.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/rubber-carousel/dist/jquery.rubber-carousel.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jmodal/src/jquery.jmodal.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/scrollReveal.js/dist/scrollReveal.min.js Failed to load resource: the server responded with a status of 403 (Forbidden)

Whats the problem can be?

like image 983
toliklunev Avatar asked Feb 23 '15 21:02

toliklunev


2 Answers

I was facing the same issue. It is because you are trying to access files inside the vendor directory. Static files inside the ‘vendor’ folder cannot be accessed due to some heroku permission issues.

I moved the files to a new directory named 'js', and re-deployed the app. Works fine now.

like image 74
Abhishek Poojary Avatar answered Oct 05 '22 20:10

Abhishek Poojary


Make sure your static directories do not have reserved word in Heroku such as vendor and bin To get more information see devcenter.heroku.com/articles/deploying-php

like image 38
Rami Salim Avatar answered Oct 05 '22 18:10

Rami Salim