我已经将我的简单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)
问题会是什么呢?
发布于 2020-05-26 19:47:37
我也面临着同样的问题。这是因为您正在尝试访问供应商目录中的文件。由于某些heroku权限问题,无法访问“vendor”文件夹中的静态文件。
我将文件移动到一个名为'js‘的新目录中,并重新部署了应用程序。现在可以正常工作了。
发布于 2019-10-02 22:18:43
确保您的静态目录在Heroku中没有保留字,如供应商和bin要获取更多信息,请参阅devcenter.heroku.com/articles/deploying-php
发布于 2015-04-03 20:33:39
这是由于.htaccess文件中的配置错误
如果.htaccess文件中有任何RewriteRule,请在其前面添加这些RewriteCond。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d例如,此代码允许您将除静态文件以外的所有请求重定向到index.php
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /index.phphttps://stackoverflow.com/questions/28684192
复制相似问题