0
你好我需要一個幫助,我在我的應用程序Kohana中使用,並創建了一個名爲media to imgs,css和js的根文件夾,所以我想保護訪問它沒有url爲了網站的功能,是這樣做的?我如何使用htaccess保護文件夾Kohana 3.2 App
實施例:
- app文件夾
- 系統文件夾
- 模塊夾
- 媒體新文件夾(我需要保護該文件夾)
- 的index.php
我的.htaccess文件是:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase/
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
我需要保護的文件夾只有媒體,我該怎麼辦? –
嘗試'RewriteRule^media /(.*)- [F]' – biakaveron
工作正常不能訪問該文件夾,但對於我訪問的css文件? –