I have been Googling all over for a solution or something that could direct me to a solution for deploying my Kohana 3.3 site but to no avail.
I am confused on on how make the routing work in Kohana, I left the default route in my bootstrap.php file intact. Here:
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
I'm using a free web hosting and sub-domain and here's my URL: http://atosoft.neq3.com/. And that outputs "hello, world" just fine, with the route above.
But when I want to go to my admin page I get an ERROR 500 here: http://atosoft.neq3.com/admin. How do I set my route to make this work for all controllers?
I do not have sub directories in my Controllers and Models, just in my Views.
Here's my folder structure:
/Controller
- Admin.php
- Courses.php
- Exams.php
- Questions.php
- Semester.php
- User.php
- Welcome.php
Controller/admin.php
class Controller_Admin extends Controller_Template {
public $template = 'admin_template';
public function action_index() {
// User authentication
$user = Auth::instance()->get_user();
if(Auth::instance()->logged_in()) {
// Display Dashboard here
$dashboard = View::factory('admin/index');
$this->template->user = $user;
$this->template->content = $dashboard;
} else {
HTTP::redirect('user/login');
}
}
}
.htaccess
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /atosoft.neq3.com/
# 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]
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/$0 [PT]
RewriteRule .* index.php [PT]