我想知道,我如何能够访问公共文件,放置在放置在/ applications/views /内的名为'Sample'的文件夹中。允许访问Codeigniter中的 application 文件夹内的文件夹
我试图用.htaccess文件来做到这一点。
这是我现在使用的.htaccess文件。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /0.9.1
#Removes access to the system folder by users.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#Enable access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|application\views\Sample\/public)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
任何帮助,将不胜感激。谢谢。
你的公共文件应该放在'。/ assets'中,而不是'。/ application'中,任何东西都不应该从该文件夹传递给浏览器。 –