如何访问应用程序文件夹中的资源? [英] How to access resources within application folder?

查看:110
本文介绍了如何访问应用程序文件夹中的资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我完全意识到,存在一个更好的实现,将资源文件夹与应用程序(不在内部)。所以是的。

First of all, I am fully aware that a better implementation, putting resources folder alongside application (not inside), exists. So yeah.

Resources = js,css,images。

Resources = js, css, images.

这只是一个要求,想法如何?

This is just really a requirement, so any ideas how? I tried it but it says 403 (Forbidden).

推荐答案

这是可以使用的解决方案之一

This is one of the possible solutions you can use

/applications
    /resources
      .htaccess
.htaccess

.htaccess 的应用程序文件夹包含拒绝所有

.htaccess of applications folder contains Deny from all

(它是CI默认值,这是您获得403 Forbidden的原因)

(it is CI default. which is the reason you get 403 Forbidden)

.htaccess 内部资源文件夹中保留允许所有

now make an .htaccess inside resources folder and keep it Allow from all

(因此您只是可以访问resources文件夹)

(so you are just allowing the resources folder to be accessible)

这篇关于如何访问应用程序文件夹中的资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆