CI doesn't find uri string |
[eluser]Windekewaai[/eluser]
I've put my controllers in subfolders to keep things tidy. I do this in all my latest projects and it all works fine. But somehow things are going wrong in my very latest project. It seems CI can't find the URI string anymore - or at least the parameters in it. I have a controller named "Nieuws" (news) in the folder "Admin" with a function "Wijzigen" (edit). The function expects a parameter $id. I call the function like this: http://example.com/admin/nieuws/wijzigen/4 The function gets called correctly, but he doesn't receive the parameter. The function uri_string() of the uri library returns an empty string.. Any help is much appreciated. A little extra info: - I produced this error with both CI 1.7.1 and CI 1.7.2 - I placed the applications folder outside the system folder (did that with all my projects) - I'm running the project locally with XAMPP on a Windows Vista Ultimate x64 machine and using Firefox 3.5.3.
[eluser]Dam1an[/eluser]
The first thing to check would be if any of the other URI_PROTOCOLs listed in the config file work
[eluser]Windekewaai[/eluser]
I checked that and none seem to solve the issue. My other projects that work use the AUTO mode, but it doesn't work on this one.
[eluser]Dam1an[/eluser]
Hmmm... Is that the only controller/function that can't seem to receive parameters? What about top level controllers? What do you get if you echo $_SERVER{@REQUEST_URI'] I'd be supriced if that didn't return anything, and I assume tats what CI uses (either as default or when set) so if it's there and not in CI, I'm confused, and if it's not there, I'm also confused :S
[eluser]Windekewaai[/eluser]
When echoing $_SERVER['REQUEST_URI'] I get the URI (/admin/nieuws/wijzigen/4). I'm not using top level controllers, but just to test I quickly built one. There also the URI can't be found and the function crashes due to it can't find the parameter.
[eluser]Windekewaai[/eluser]
My .htaccess file (in the folder where the CI index.php file is): Code: RewriteEngine On My Apache httpd.conf file: Code: LoadModule rewrite_module modules/mod_rewrite.so In the CI config file: Code: $config['index_page'] = ''; Anyone have a clue?
[eluser]Windekewaai[/eluser]
I managed to fix the problem myself after hours of searching. I changed the .htaccess file in this: Code: RewriteEngine on However, I still don't know what actually caused this strange behaviour. Thanks anyway for your help Dam1an! Much appreciated. |
Welcome Guest, Not a member yet? Register Sign In |