CI 3 URI::_parse_request_uri() function |
I am setting up CodeIgniter 3 RC3.
I have an app called my_app. On my Web server I created a folder named "my_app" and in this folder I created index.php file which is a symlink to actual CodeIgniter index.php So the directory structure is something like this: Code: +--www Apache is set to reroute all requests to my_app folder to the my_app/index.php. In this way there is no index.php in browser's URL input field. So whenever I visit www://example.org/my_app the my_app.php within CodeIgniter is being called. To call a particular method in the controller I will call www://example.org/my_app/method. But here is the problem: There is _parse_request_uri() function in the CI_URI class where I found following code: PHP Code: if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0) Per this code snippet if URI starts with the directory name of the script, the directory name gets chopped off. And this appears to break my setup. If I call www://example.org/my_app/method, the htdocs/my_app/index.php is being called. PHP Code: dirname($_SERVER['SCRIPT_NAME']) PHP Code: elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0) modifying original URI my_app/method to just method There is no controller method and as result I am getting error 404. Can anyone here explain what is the purpose of the above code snippet and why is it needed? I am wondering only because I managed to run into trouble while implementing new setup with CodeIgniter. |
Welcome Guest, Not a member yet? Register Sign In |