wrong controller in my first CI 3 |
i just download CI and i take 2 folder application and system to my webfolder,
i move index.php to be inside application and i have modified the .htaccess my webfolder is C:\onedrive\dropbox\template\ and my access url is http://localhost/template/application/index.php but every time i open http://localhost/template/application/ always said : 404 Page Not Found, The page you requested was not found. when i debugging to CodeIgniter.php PHP Code: var_dumpt($RTR->class); Code: 'template' that why my url always wrong, why this is happened? i just modify 'Router.php' in method '_set_request' in the first line to exclude my url for segmentation : PHP Code: // akhyar : exclude url before index.php first become : PHP Code: protected function _set_request($segments = array())
First, you shouldn't be modifying anything in the system directory. Even if you needed to fundamentally alter the way CodeIgniter works for some reason, you could still do so 99.99% of the time without modifying a single file in the system directory.
Second, your issue is a configuration issue, either in your /application/config/config.php file, your .htaccess file, or whatever file you're using to configure your web server (such as a .conf file for Apache). Third, why did you put your index.php file inside your /application directory? Your /application and /system directories should not be accessible from a web browser, and every request has to be routed through index.php, so it should not be in a directory that should not be accessible from a web browser. I usually put my index.php, all of my CSS/JavaScript/image files, and any documents which need to be available for download in a /public directory, then make that my site's root directory in my Apache .conf file (with /application, /system, etc. outside of that). |
Welcome Guest, Not a member yet? Register Sign In |