• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Everything routes to the default controller

Hi All,

I have a VERY weird problem. MY application works fine on some servers, and on others it doesn't work at all. And here is the problem....

On the servers that I have a problem, no matter what url I request, all the requests are routed to the default controller. For example, the ap;lication on this server doesn't work. If I go here:


I get the default controller, which is fine. But if I go here:


... I should get the Test controller.Instead, I get routed to the default controller again for some reason.

If I change the default controller to the Test one, then it routes all the requests to that controller because that one is the default one. I am completely confused why I am getting this problem. On other servers, the application runs fine. So I am wondering how the server can impact the routing?

You can see the PHP info for the server here so you can see what kind of a server I am running this on:


I am running Codeigniter 2.0.2, and the server meets the minimum requirements running PHP 5.2.9. I am completely confused!

Any help is appreciated because this is a very important client of mine.


BTW, the application is now residing on a shared hosting server. Could that be the cause of this maybe? If so, why would that be?

Anyone from CI care to look at this please?

What does your htaccess file look like? I think that's where the bug is because if you put index.php into the url you can get to the test controller.


Thanks for the reply bubbafoley!

The problem is not in the htaccess file, but in the routing for CI Reactor 2.0. I just found this topic:


It seems like there is a bug with Codeigniter Reactor 2.0. But, I am using CI Reactor 2.0.2 and this should have been resolved, but it is NOT. When I change $config['uri_protocol'] to "ORIG_PATH_INFO", it does work on this server. But, it doesn't work on another server like that. I need this application to be working on any server with MINIMAL user involvement in these things because this gets complicated for a regular user who is supposed to just upload my application and it should work out of the box.

I read a post that the Codeigniter Core doesn't have this problem. Where do I download the core from?

Any help is appreciated. Thanks!

I think that bug occurs even without using an htaccess file which isn't the case here. If changing the config works then you can use the environment variable and have a separate config for that server. http://ellislab.com/codeigniter/user-gui...ments.html

You can download core here https://bitbucket.org/ellislab/codeigniter

Thanks bubbafoley!

LIke i said before thouhg, is that I have this application that I can give to people so they would just upload the application and it should work out of the box. If I tell them to go and change configuration variables, they will get frustrated and not use the application. See my point? If it was me that uploads the files every time, then it is not a problem. But it isn't unfortunately. So, I need to find a way to make this work on every server, no matter which one without people having to change config variables.

I did download CI Core and tried it, but it doesn't work again. I still have to change the config variable. Sad

I think I had seen an implementation in pyrocms installation routine to write at setup config files.

Did the post you submitted help you? did you try in your code that code?

On some servers the htaccess needs to be
RewriteRule ^(.*)$ index.php?/$1 [L] (with question mark)
instead of
RewriteRule ^(.*)$ index.php/$1 [L]

Thanks to all of you. These seem to work. However, in my case, I think that I will give my clients an alternative htaccess file with the correction that Cronix suggested because it seems the least painful way to go.

if there is any other suggestions, please keep them coming. Thanks!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.