Welcome Guest, Not a member yet? Register   Sign In
Only Default Controller Working
#1

Hi,

Only my default controller works. If I comment out my is_logged_in check, my default controller loads. If I do the same with any other controller, they do not work. So if I go to Welcome with log in check disabled, everything is fine. If I do log in check and get redirected to domain/auth/login, 404 page not found.

this is my .htaccess in root folder.Mod_Rewrite works because I do get 500 internal error with mistakes in .htaccess file.

Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

My config is:
Code:
$config['base_url'] = 'http://sub.domain.com';
$config['index_page'] = '';
$config['uri_protocol']    = 'REQUEST_URI';

I've tried so many different things and nothing works. I'm at a complete loss.

Thanks for your help in advance.
Reply
#2

and if you do this ?

domain/index.php?/auth/login
Reply
#3

No dice. That also throws a 404 - page not found error.
Reply
#4

try without your htaccess and specify index.php in your $config['index_page']

if http://sub.domain.com/index.php?/auth/login work, it's your mod_rewrite.

if not, you maybe have a problem with apache or nginx. (can't use htaccess like that with nginx)
Reply
#5

(This post was last modified: 04-21-2016, 06:54 PM by ciadmin.)

This my be related to the base_url config setting ... there was a change in CI3.0.3, described on the "upgrading" page:
http://www.codeigniter.com/user_guide/in...e_303.html
James Parry
Project Lead
Reply
#6

not much info to understand, but i would make sure via apache logs if the URL is the expected one (to verify .htaccess works as expected) and if your controllers are in expected location.

Please keep in mind that first letter has to be uppercase in 3.X and onwards, both in file and in Class name.

is this a new application you are working on, or you upgraded CI and then problem came up?
Reply
#7

(03-02-2016, 10:04 AM)keulu Wrote: try without your htaccess and specify index.php in your $config['index_page']

if http://sub.domain.com/index.php?/auth/login work, it's your mod_rewrite.

if not, you maybe have a problem with apache or nginx. (can't use htaccess like that with nginx)

Keulu - That doesn't work either unfortunately. Thanks for ideas though.
Reply
#8

(03-02-2016, 05:17 PM)iz_no_good Wrote: not much info to understand, but i would make sure via apache logs if the URL is the expected one (to verify .htaccess works as expected) and if your controllers are in expected location.

Please keep in mind that first letter has to be uppercase in 3.X and onwards, both in file and in Class name.

is this a new application you are working on, or you upgraded CI and then problem came up?


Controllers are uppercase but filenames were not, I switched to uppercase Auth.php and boom! Works, you are a legend!

Thanks so much!
Reply
#9

(This post was last modified: 03-02-2016, 10:15 PM by picotrain.)

(03-02-2016, 12:54 PM)jlp Wrote: This my be related to the base_url config setting ... there was a change in CI3.0.3, described on the "upgrading" page:
http://www.codeigniter.com/user_guide/in...t=base_url

Thanks for your idea, got solution, see above. Silly me!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB