Welcome Guest, Not a member yet? Register   Sign In
default_controller help
#1

[eluser]jordanarseno[/eluser]
From my understanding, the default controller is loaded when no controller is specified.

e.g. After pointing your browser to http://localhost/Project/index.php/, CodeIgniter will redirect you to the default controller, say - main, http://localhost/Project/index.php/main.

But what If I want the default controller to be http://localhost/Project/index.php/ itself?

I want my home page to be displayed at http://localhost/Project/index.php/

How do I configure CI to do this?

I will remove the index.php with the .htaccess file later.
#2

[eluser]WanWizard[/eluser]
http://localhost/Project/index.php/ is not a controller, so how can it be the default controller?

The whole idea behind the default controller is what to do when someone requests the website root (so no URI is present). Normally that's the controller that displays your landing page. Note that it does NOT redirect, it just loads. The URI remains unchanged.
#3

[eluser]Crimp[/eluser]
There's a very nice surprise for you at the top of the routes.php file in the config folder...




Theme © iAndrew 2016 - Forum software by © MyBB