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

I've been stuck on this for several days now. I'm attempting to deploy CI 3+ app to GoDaddy server (Linux, CPanel), shared hosting acct.

I've placed myapp in subfolder 'CIP17'  directly below public_html folder that's below my acct root directory.

I have a non-CI version of this app in another subfolder at the same level that works OK.

The new CI version works OK on my localhost.

I want myapp to open at login page, login controller: 'c_login', Login controller file: 'c_login.php', 'class C_login extends CI_Controller   { . . . }

I also placed the CI 'Welcome' controller in same controller folder and the CI 'welcome_message' in my views folder.

In config/routes file:

    $route['default_controller'] = 'c_login'; (I did try 'C_login', no joy.)
    $route['404_override'] = '';
    $route['translate_uri_dashes'] = FALSE;

In config/config file:
    $config['base_url'] = 'https://myapp.com/CIP17/';
    $config['index_page'] = ''; //index.php';
    $config['uri_protocol']    = 'REQUEST_URI'; //'QUERY_STRINGS'; // 'PATH_INFO'; //

I have an .htaccess file in the /CIP17/ app folder that seems to be working so that I don't need 'index.php in every URI  - although I only have a vague understanding of what these commands do individually:
    RewriteEngine On
    RewriteBase /CIP17/
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]

When I load 'https://myapp.com/CIP17/' to browser address bar I get: '404 Page Not Found'

When I type 'https://myapp.com/CIP17/c_login' in browser address bar I get: '404 Page Not Found'.

WhenI type 'https://myapp.com/CIP17/index.php/c_login' in browser address bar I get: '404 Page Not Found'.

When I type 'https://myapp.com/CIP17/C_login' in browser address bar I get: '404 Page Not Found'.

When I type 'https://myapp.com/CIP17/Welcome' in browser address bar I get the CI Welcome page.

I changed filename of 'Welcome.php' to 'Welcomex.php'  and tried 'https://myapp.com/CIP17/Welcomex.php'. I got '404 Page Not Found'. But when I changed the file names back to 'Welcome.php' I got the Welcome page again.

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.

Any suggestions on how I'm screwing up would be greatly appreciated. Even just an idea of where I should look would be helpful at this point.
Reply


Messages In This Thread
CI system can't see default controller set in config/routes - by codeguy - 06-05-2017, 10:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB