Welcome Guest, Not a member yet? Register   Sign In
SOLVED: Default Controller always loads instead of everything else
#1

[eluser]MCrittenden[/eluser]
I've been running a site under CI for a couple weeks now with no problems. I guess I must have screwed something up on the last couple days.

No matter which page you try to load, the default_controller loads. If I change the default_controller, then the new one will load in place of all of the other controllers.

For example, I have a "photo" controller. If I go to mywebsite.com/photo (I have index.php taken out via .htaccess), the URL stays at /photo, but the home page loads because "home" is the default controller.

I'll be happy to post any code that might help you guys. The routes.php and config.php files all look right to me. I rechecked .htaccess and it's still the same.

Thanks a lot in advance.
#2

[eluser]Matthew Pennell[/eluser]
Sounds like a routes problem to me - are you sure you've got the matches in the correct order?
#3

[eluser]MCrittenden[/eluser]
I actually don't have anything but the defaults. Here's my routes.php:
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| LOTS OF COMMENTS
|
*/

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


/* End of file routes.php */
/* Location: ./system/application/config/routes.php */

That look ok?
#4

[eluser]MCrittenden[/eluser]
NEVER MIND Smile

I have no idea what caused the problem (probably my host screwing around with settings) but...
Code:
$config['uri_protocol']    = "REQUEST_URI";
instead of "AUTO" in config.php fixed it right up. Thanks!
#5

[eluser]coldKingdom[/eluser]
[quote author="MCrittenden" date="1213131871"]NEVER MIND Smile

I have no idea what caused the problem (probably my host screwing around with settings) but...
Code:
$config['uri_protocol']    = "REQUEST_URI";
instead of "AUTO" in config.php fixed it right up. Thanks![/quote]

You really made my day. Just got a new web hosting company for a site I'm making and the default controller always got loaded.

Your simple solution works like a charm, thank you! :coolsmile:




Theme © iAndrew 2016 - Forum software by © MyBB