Newb problem |
[eluser]MiniMonty[/eluser]
Hi all, new to CI and seem to be falling at the first hurdle ! I've loaded the CI folders onto the root of my server. Tested with www.mydomain.com and I see the "Welcome to CodeIgniter!" front page. So I followed the tutorial to make a new "blog" controller. But when I test with: www.mydomain.com/index.php/blog I get a 404. I've changed config.php line 14 from http://example.com/ to http://www.mydomain.com/ is there anything else I need to configure ? Best wishes Monty
[eluser]Ivar89[/eluser]
so you have this: Code: $config['base_url'] = "http://example.com/"; Maybe if you show some of the controller we can actually help...
[eluser]MiniMonty[/eluser]
I have this in my config file: Code: $config['base_url'] = "http://www.mydomain.com/"; And this in "blog.php" in the controllers folder: Code: <?php as per the example in the user guide. Best wishes Monty
[eluser]Ivar89[/eluser]
use a lowercase "b" in blog not Blog don't know if thats the problem but you should always use lowercase.
[eluser]MiniMonty[/eluser]
[quote author="noctrum" date="1276888793"]Is it an apache 404 or the codeigniter 404?[/quote] It's an Apache 404. "Not Found The requested URL /index.php/blog was not found on this server."
[eluser]pickupman[/eluser]
You need to add the class constructor. Try this: Code: <?php
[eluser]danmontgomery[/eluser]
[quote author="pickupman" date="1276901596"]You need to add the class constructor. [/quote] This isn't entirely true... As with any other class method if a constructor isn't defined then the parents is inherited. If it's an apache 404 the request isn't being routed through CI at all, which indicates a problem with the Apache configuration (CI will show it's own 404). Do you have a stray .htaccess, or have you changed anything in httpd.conf?
[eluser]MiniMonty[/eluser]
Quote:Do you have a stray .htaccess, or have you changed anything in httpd.conf? No .httaccess, haven't changes anything in httpd.conf I added the class constructor - no joy, still getting "Not Found" etc., Pretty stumped by this.
[eluser]pickupman[/eluser]
For sake of diagnosing the issue, can you serve up a standard file like test.html and use www.mydomain.com/test.html, and then try a php file like test.php. Then try www.mydomain.com/test.php. You need to figure out if your server is configured properly. If you are getting a 404 error on those files, you have a problem with your apache configuration. It might be pointing to the wrong folder, or file ownership needs to be to the same group apache is in. |
Welcome Guest, Not a member yet? Register Sign In |