![]() |
Default controller doesn't appear to be working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Default controller doesn't appear to be working (/showthread.php?tid=23495) |
Default controller doesn't appear to be working - El Forum - 10-13-2009 [eluser]feejin[/eluser] My local development site in MAMP works fine, put it on my live hosting in a subfolder for testing and I get 404 errors when I don't pass a controller. E.g. http://www.website.com/dev/ <-- 404 http://www.website.com/dev/Blog <-- Works correctly I'm using this .htaccess to remove index.php from the URI: Code: RewriteEngine On Hosting definitely supports mod_rewrite, I have other stuff on there using it - including a Wordpress install that uses a very similar rewrite. I've printed out the $_SERVER variable and it shows that it's going for the right script (http://www.website.com/dev/index.php) In config I've set everything up like (I think) it should be, relevant parts are: Code: $config['base_url'] = "http://www.website.com/dev/"; And in routes I have Code: $route['default_controller'] = "Blog"; Any idea what might be wrong? Hoping it's something simple, this is driving me crazy! Thanks, Colin Default controller doesn't appear to be working - El Forum - 10-13-2009 [eluser]imn.codeartist[/eluser] Instead of this: Code: $config['base_url'] = "http://www.website.com/dev/"; Try this Code: $config['base_url'] = "http://www.website.com/dev"; remove the backslash at the end then it should works Default controller doesn't appear to be working - El Forum - 10-13-2009 [eluser]feejin[/eluser] Thanks for the reply. Still getting 404 error though! I'm sure it will be something that simple but I just can't see what could be wrong. I've removed the .htaccess file entirely, changed the config to this: Code: $config['base_url'] = "http://www.website.com/dev"; Now I get these results: http://www.website.com/dev/index.php <-- 404 http://www.website.com/dev/index.php/Blog <-- Works I'll keep hunting, in the meantime any suggestions are appreciated. Default controller doesn't appear to be working - El Forum - 10-13-2009 [eluser]feejin[/eluser] Fixed! Changed controller filename and default controller to lowercase. I guess it was getting confused with the actual filename (Blog) and the class Blog? Anyway, all working as expected now. |