Kohana htaccess file

sixone74
2010-08-06T16:02:07Z

.htaccess

| RewriteEngine on
| RewriteBase /
|
| # Add www rule
| # RewriteCond %{HTTP_HOST} ^example.com$ [NC]
| # RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
|
| # Remove www rule
| RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
| RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]
|
| # Trailing slash
| RewriteCond %{REQUEST_FILENAME} !-f
| RewriteCond %{REQUEST_URI} !(.*)/$
| RewriteRule ^(.*)$ $1/ [R=301,NC,L]
|
| # Secure directories
| RewriteRule ^(application|system) index.php/$1 [L]
| RedirectMatch 404 /\.git(/|$)
| RedirectMatch 404 /\.svn(/|$)
| RedirectMatch 404 /css/(/|$)
| RedirectMatch 404 /fonts/(/|$)
| RedirectMatch 404 /images/(/|$)
| RedirectMatch 404 /js/(/|$)
| RedirectMatch 404 /temp/(/|$)
|
| # Kohana bootstrap
| RewriteCond %{REQUEST_FILENAME} !-f
| RewriteCond %{REQUEST_FILENAME} !-d
| RewriteRule ^(.*)$ /index.php/$1 [QSA,L]
|
| #Force PDF download
| <FilesMatch "\.(?i:pdf)$">
| ForceType application/octet-stream
| Header set Content-Disposition attachment
| </FilesMatch>
|
| # Redirect old search page to new search page
| # redirect 301 /search/index.html /foobar/search
| # redirect 301 /search /foobar/search