-1
Im試圖訪問畫廊/ 2/image.jpg,但Kohana認爲它的路線,所以它返回一個錯誤「無法找到URI路線畫廊」在Kohana關閉/排除路線,例如我的畫廊/目錄
那麼如何關閉特定的目錄/路由名稱,以便我可以訪問圖像?
Im試圖訪問畫廊/ 2/image.jpg,但Kohana認爲它的路線,所以它返回一個錯誤「無法找到URI路線畫廊」在Kohana關閉/排除路線,例如我的畫廊/目錄
那麼如何關閉特定的目錄/路由名稱,以便我可以訪問圖像?
你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_URI} ^.+$
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|pdf)$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule^- [L]
# Rewrite all other URLs to index.php/URL
RewriteCond ${REQUEST_URI} ^!galleries/.*$
RewriteRule .* index.php/$0 [PT]
應該被髮送到路由引擎排除。
你使用kohana 3.0,3.1或3.2的方式? – 2011-12-14 00:53:12
如果您的`.htaccess`設置正確,以便在不處理URL的情況下提供文件並且仍然存在,則您的URL可能不正確。 – alex 2011-12-14 00:53:36