Welcome Guest, Not a member yet? Register   Sign In
Setting default controller
#1

[eluser]MABUS[/eluser]
I usually arrange my controller classes and group them into folders. Like for example, there is an "admin" folder for the controllers that belong to the admin side of a web application. Now, I'm having problems setting up my default controller. I have this entry on my routes.php file ...

$route['default_controller'] = "frontend/HomeController";

and it is supposed to point to load that controller on default. This problem occurs only when the app is running on a linux environment. Running it on windows would definitely load the controller in the proper way.

I am not sure if it is an .htaccess file issue, it could probably be. Here's the contents to my .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]

Did I miss something here? Ploease share your thoughts about this.

Belated Happy holidays to you all
#2

[eluser]Frank Berger[/eluser]
the default_controller is the default controller in all directories. if you set it like this:

$route[‘default_controller’] = “HomeController”;

then it is the default-controller in any directory under application/controllers/. for example:

controllers/HomeController.php
controllers/frontend/HomeController.php
controllers/backend/HomeController.php
controllers/rss/HomeController.php

and are called respectively like this:

http://site/index.php
http://site/index.php/frontend
http://site/index.php/backend
http://site/index.php/rss

or if you hide the index.php:

http://site/
http://site/frontend
http://site/backend
http://site/rss


bye

Frank
#3

[eluser]MABUS[/eluser]
YES, I am able to use the default controller. The problem is that when I run this application on a windows / unix system, I cant' seem to get to the the default controller. That means that there might be something wrong with the configuration on the webserver or the .htaccess that I have.




Theme © iAndrew 2016 - Forum software by © MyBB