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.com/js/i_load_fine.js
https://example.com/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 recommended RewriteCond:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
I 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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With