emersonthis emersonthis - 23 days ago 9x
Javascript Question

403 error for js files in vendor directory on Heroku

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


CSS and javascript files outside that directory load fine.



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]


Turns out that I had to specify the document root as a second parameter in the Procfile: web: vendor/bin/heroku-php-apache2 webroot/