403 for js files in the suppliers directory on Heroku

My CakePHP v3.x application works 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 this directory load in order.

 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> 
+5
source share
3 answers

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

+1
source

I wonder if the "provider" is a reserved word in Heroku?

yes, if you use the name of the folder "vendor", there may be a 403 error error. Because the web server is the root directory of vendor/bin/ . Do not use the public name "vendor" and "bin".

+6
source

For what it's worth, I just saw the same problem (I had a "vendor" folder that got 403 errors all the time).

I renamed the provider folder to "v" (and fixed links) and it worked just fine.

I wonder if the "provider" is a reserved word in Heroku?

0
source

Source: https://habr.com/ru/post/1234306/


All Articles