2015-02-23 18 views
6

Tôi đã đẩy ứng dụng php đơn giản của mình lên Heroku và nhận trạng thái 403 đối với một số tệp js.Heroku 403 bị cấm đối với các tệp js tĩnh

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 Failed to load resource: the server responded with a status of 403 (Forbidden) 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)

Có vấn đề gì?

+0

không ai biết câu trả lời? m đối mặt với cùng một vấn đề – LNT

Trả lời

0

Đó là do cấu hình sai trong tập tin .htaccess

Nếu có bất kỳ RewriteRule trong tập tin .htaccess bạn thêm các RewriteCond trước khi nó.

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

Ví dụ mã này cho phép bạn chuyển hướng tất cả các yêu cầu ngoại trừ các file tĩnh để index.php

Options +FollowSymLinks 
RewriteEngine On 
RewriteCond %{REQUEST_URI} !=/index.php 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule .* /index.php 
Các vấn đề liên quan