My CakePHP v3.x app runs fine in my local Vagrant environment, but when I deploy to Heroku, I get 403 errors for all javascript files located in /webroot/vendor/...
CSS and javascript files outside that directory load fine.
.js
.js
/Procfile
web: vendor/bin/heroku-php-apache2
This question sounds similar, but I checked and .htaccess already has the remended RewriteCond:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
My CakePHP v3.x app runs fine in my local Vagrant environment, but when I deploy to Heroku, I get 403 errors for all javascript files located in /webroot/vendor/...
CSS and javascript files outside that directory load fine.
https://example./js/i_load_fine.js
https://example./vendor/i_cause_403_error.js
/Procfile
web: vendor/bin/heroku-php-apache2
This question sounds similar, but I checked and .htaccess already has the remended RewriteCond:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Share
Improve this question
edited May 23, 2017 at 11:55
CommunityBot
11 silver badge
asked Oct 22, 2015 at 17:55
emersonthisemersonthis
33.4k60 gold badges222 silver badges384 bronze badges
3 Answers
Reset to default 9I wonder if "vendor" is a reserved word in Heroku?
yes, if you will be use "vendor" folder name, may be error 403 errors.
Because root dir web server vendor/bin/
.
Don't use public name "vendor" and "bin".
For what it's worth, I just saw the same issue (had a "vendor" folder that kept getting 403 errors).
I renamed the vendor folder to "v" (and fixed references) and everything worked just fine.
I wonder if "vendor" is a reserved word in Heroku?
Turns out that I had to specify the document root as a second parameter in the Procfile: web: vendor/bin/heroku-php-apache2 webroot/