1.6 Default Route

#10
[eluser]cynge[/eluser]
As a quick note, I am using a relative url in my $config['base_url']. Something like '/folder/subfolder/'. My $config['index_page'] is 'index.php?'.

So when going to http://mysite.com/folder/subfolder/, the URI library sees PATH_INFO like /folder/subfolder/index.php. The Router then uses the segments created from the uri_string (Router around Line 91). CI thinks you are trying to use 'folder' as a controller, 'subfolder' as a method, and passing 'index.php' as an argument (or it's looking in the directory 'folder' for the controller 'subfolder'). Can you see where things are going wrong?

The only way I can think of to fix it without modifying the core URI directly (because I don't know if what we are experiencing is a true bug or us not knowing some configuration) is to patch the uri_string in Router before segments get created. I gave 2 suggestions in my post.

For the 2nd one that you are asking about... after fetching the uri_string around Line 91 of Router, I am removing the '?' in my $config['index_page'] and then removing my base_url and index page from the uri_string... leaving me with everything after the uri, which should be nothing so the default controller is used. I did it this way so I didn't have to hardcode that info. It's such a simple fix that I swear either we are not configuring something right or else PATH_INFO is not being used right in the URI core.

The 1st option I gave just gives one last chance to use the default controller before show404().


Messages In This Thread
1.6 Default Route - by El Forum - 02-11-2008, 09:06 PM
1.6 Default Route - by El Forum - 02-13-2008, 04:42 PM
1.6 Default Route - by El Forum - 02-18-2008, 12:17 AM
1.6 Default Route - by El Forum - 02-18-2008, 12:30 AM
1.6 Default Route - by El Forum - 02-18-2008, 12:54 AM
1.6 Default Route - by El Forum - 02-18-2008, 01:05 AM
1.6 Default Route - by El Forum - 02-18-2008, 08:14 AM
1.6 Default Route - by El Forum - 02-27-2008, 03:47 AM
1.6 Default Route - by El Forum - 02-29-2008, 08:31 AM
1.6 Default Route - by El Forum - 02-29-2008, 10:52 AM
1.6 Default Route - by El Forum - 02-29-2008, 11:15 AM
1.6 Default Route - by El Forum - 03-26-2008, 04:08 PM
1.6 Default Route - by El Forum - 03-26-2008, 08:01 PM
1.6 Default Route - by El Forum - 03-26-2008, 08:12 PM
1.6 Default Route - by El Forum - 03-27-2008, 06:33 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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