最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - 403 error for js files in vendor directory on Heroku - Stack Overflow

programmeradmin3浏览0评论

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
Add a ment  | 

3 Answers 3

Reset to default 9

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?

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

发布评论

评论列表(0)

  1. 暂无评论