首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Heroku 403禁止静态js文件

Heroku 403禁止静态js文件
EN

Stack Overflow用户
提问于 2015-02-24 05:51:53
回答 3查看 1.9K关注 0票数 8

我已经将我的简单php应用程序推送到Heroku,并获得了一些js文件的403状态。

https://guarded-forest-7267.herokuapp.com/vendor/jquery/dist/jquery.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-form/jquery.form.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-validate/dist/jquery.validate.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery.inputmask/dist/inputmask/jquery.inputmask.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/modernizer/modernizr.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jselector/src/jquery.jselector.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/rubber-carousel/dist/jquery.rubber-carousel.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jmodal/src/jquery.jmodal.js D15 https://guarded-forest-7267.herokuapp.com/vendor/scrollReveal.js/dist/scrollReveal.min.js Failed to load resource: the server responded with a status of 403 (Forbidden)

问题会是什么呢?

EN

回答 3

Stack Overflow用户

发布于 2020-05-26 19:47:37

我也面临着同样的问题。这是因为您正在尝试访问供应商目录中的文件。由于某些heroku权限问题,无法访问“vendor”文件夹中的静态文件。

我将文件移动到一个名为'js‘的新目录中,并重新部署了应用程序。现在可以正常工作了。

票数 2
EN

Stack Overflow用户

发布于 2019-10-02 22:18:43

确保您的静态目录在Heroku中没有保留字,如供应商和bin要获取更多信息,请参阅devcenter.heroku.com/articles/deploying-php

票数 1
EN

Stack Overflow用户

发布于 2015-04-03 20:33:39

这是由于.htaccess文件中的配置错误

如果.htaccess文件中有任何RewriteRule,请在其前面添加这些RewriteCond

代码语言:javascript
复制
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

例如,此代码允许您将除静态文件以外的所有请求重定向到index.php

代码语言:javascript
复制
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.php
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28684192

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档