the_unforgiven_II
the_unforgiven_II

Reputation: 361

URI routing Codeigniter

Having problems with routing in CodeIgniter.

Here's my routes.php

$route['default_controller'] = "site/site/index/$1";
$route['404_override'] = '';
$route['admin'] = 'admin/index';

I'm using modular system and my folder format is:

folder

In side the modules > site > controllers >site.php i have the following that gets the path of each that is entered into the cms, but the problem is when i navigate to localhost/my_site/ it shows the page but with errors, so if i put the following route in: $route['site/(:any)'] = 'site/site/index/$1'; it then works and shows all the pages but obviously I don't want this, i want it to know that the home page is set. Or can this be done via htaccess DirectoryIndex ??

If this doesn't make sense or you cant understand what i mean give me a shout and i'll try explain more details, but that's about it the problem.

Upvotes: 0

Views: 122

Answers (1)

Pattle
Pattle

Reputation: 6016

I think its because you default controller expects a parameter but you are not passing it one

$route['default_controller'] = "site/site/index/$1";

I think it should be

$route['default_controller'] = "site/site/index";

Upvotes: 1

Related Questions