sys_debug
sys_debug

Reputation: 4003

How to load an index page without a controller

I have a question and apologies if it is too simple but I really couldn't figure it out. If I have my domain for example: www.shop.com. I changed .htaccess to omit the need for index.php. Now I am wondering how can I load for example a page (main home page) without having any controller in url address. E.g.:

www.shop.com =========> should land me on the home page of my site.

currently the only way I can do it is by defining a controller and doing this:

www.shop.com/controller/

Thanks and your help is much appreciated :)

Upvotes: 0

Views: 320

Answers (1)

Connor Tumbleson
Connor Tumbleson

Reputation: 3330

Go to /application/config/routes.php

Add the default_controller rule like so

$route['default_controller'] = 'home';

So now in /application/controllers/home.php method index() will run on the index page.

Upvotes: 3

Related Questions