Welcome Guest, Not a member yet? Register   Sign In
CI system can't see default controller set in config/routes
#3

(06-05-2017, 11:12 AM)PaulD Wrote: Paul,

If you change the filename you also have to change the class name within the file.

Sorry if my post wasn't clear on that . . .

"Finally, I tried renaming 'c_login.php' to Welcome.php and when trying 'https://myapp.com/CIP17/Welcome' in browser address bar I got the '404 Page Not Found' error. But when I did this and also changed the class declaration to: 'class Welcome extends CI_Controller   {...} This time I got a blank page - no 404 error. The contents  inspector showed empty html and body tags."

I suspect this could be a good clue for someone who understands this better than I do.


Your config index page looks strange too, should just be 'index.php' or '' since it seems you are using htaccess to override that.

Yes, it was just $config['index_page'] = '';
That's 2 single guotes to make it blank. The //'index.php' after that was just the commented out previous content.


At a quick glance your htaccess looks good. Try removing the htaccess first of all and see if that changes anything. Until you can navigate to your new page beyond welcome it might help if you first remove that and put your 'index.php' back into your config.

OK. I took out the .htaccess and tried several versions of the address line including replacing the $config['index_page'] = ''; 
. . . with $config['index_page'] = 'index.php';  . . . and all variations in the address bar I could think of including the expected  https://myapp.com/CIP17/index.php/c_login
  . . . and got the 404 errors as before.

When I tried [i]https://myapp.com/CIP17/index.php/Welcome . . . [/i]I got the welcome page OK. But thanks for the suggestions.
Reply


Messages In This Thread
RE: CI system can't see default controller set in config/routes - by codeguy - 06-05-2017, 12:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB