Welcome Guest, Not a member yet? Register   Sign In
Basic problem with my controllers, i hope theres an easy solution...
#1

[eluser]Brokenegg.wb[/eluser]
Hey guys, Thanks in advance for any help.

So i'm new to CI, and Ive been running though the tutorials that i can find (both on and off the site) but i keep running into an issue with the basic Controllers.... basically I'm trying to get access to my file @ /index.php/home . however despite my best efforts it's not showing up. Ive copied and pasted the coding from the documentation, and still it won't work. the interesting thing is that if i set my 'home' controller as the default, it shows up just fine, however when i try to access it via /index.php/home it comes up with a 404 - page not found error... is there a basic catch that I'm missing?
here is my code:

home.php (located in my 'controller' folder under 'application':
Code:
<?php
class Home extends Controller {

    function index()
    {
        $data['welcome_msg']= 'We are currently under construction,<br />please check back on September 19th to see the Updated Site!';
        $this->load->view('home', $data);
    }
}
?&gt;

any ideas?
Thanks,
Watson
#2

[eluser]Aken[/eluser]
Do you have an .htaccess file in your web root (or root CI folder)? It may be playing tricks on your URLs. D you get a 404 error from your web server (usually an Apache notice) or from CodeIgniter?

Otherwise from a base install of CI, there should be no reason why you can't access it both as the default controller and from index.php/home.
#3

[eluser]Brokenegg.wb[/eluser]
i don't have an .htaccess file yet, and the 404 error is coming from CI (i think, it just says "404 error *in red*" and "Page not found *in black*") i also checked the documentation for trouble shooting and changed my URI Protocol info to :"index.php?"; . to no avail however... am i missing something in the System requirements? I was under the impression you just needed PHP 4.someodd or higher and MYsql...
#4

[eluser]Unknown[/eluser]
Thank you very much, I was looking for this!
#5

[eluser]Aken[/eluser]
Give this a shot... Go to your config/config.php file and change the URI_PROTOCOL to this:

Code:
$config['uri_protocol'] = "REQUEST_URI";

AUTO has always worked for me, but I've seen some other people have some issues with URL strings and such only to have it solved by that. So it can't hurt. Without an .htaccess to goof up URL redirects, it pretty much means CI isn't sure how to handle the URL it's being given, so it's slapping a 404 up.
#6

[eluser]Brokenegg.wb[/eluser]
you, my friend, are a god. that seems to have cleared up the issue!
Thanks!

also, in case there's another noob like me out there, i found a really great set of tutorials that build up from installing IC to a basic CMS at http://net.tutsplus.com/videos/screencas...tch-day-1/
#7

[eluser]Aken[/eluser]
Welcome Smile




Theme © iAndrew 2016 - Forum software by © MyBB