emersonthis emersonthis - 1 year ago 102
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]

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download