Previous

Next

CssMySite

Kohana v3.0 .htaccess

30 Sep, 2009

labels:

The .htaccess file that work with my webhost for Kohana version 3.0


# Turn on URL rewriting
RewriteEngine On

# Installation directory
#RewriteBase /

# Protect hidden files from being viewed

	Order Deny,Allow
	Deny From All


# Protect application and system files from being viewed
RewriteRule ^(application|modules|system)/ - [F,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 [L]

The differences from the example.htaccess from the Kohana v3.0 download are:

RewriteRule ^(application|modules|system)/ - [F,L]

instead of

RewriteRule ^(?:application|modules|system)\b - [F,L]

which gives an Internal Server Error and

RewriteRule .* index.php [L]

instead of

RewriteRule .* index.php/$0 [PT]

which gives a No input file specified message.