404 page not found... - 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: 404 page not found... (/showthread.php?tid=44002) |
404 page not found... - El Forum - 07-30-2011 [eluser]Ivar89[/eluser] I have 4 pages/links that are bassicly the same and three of them work but with one I get 404 error Portfolio page doesn't work. Part Controller: Code: <?php Code: view('template/header') ?> I don't know where it goes wrong...:S menu view: Code: <div id="menu"> (I know Its probably better to use anchor instead of href, but thats not the problem now. 404 page not found... - El Forum - 07-30-2011 [eluser]Ivar89[/eluser] When I go to portfolio/index it simply goes to th folder portfolio and shows me a system folder:S... while there are actually several .php files in there:S problems probably not in the code. but something somewhere has probably reserved the name portfolio:S 404 page not found... - El Forum - 07-31-2011 [eluser]Aken[/eluser] First, controller names needed to be capitalized. class Portfolio extends CI_Controller Second, what is your file structure like? Is the Portfolio controller in the root "controllers" folder, or is it in a subfolder? If you are in a subfolder, you need to specify a default controller for that directory if you want it to be accessible. You do this in Routes. Code: $route['portfolio'] = 'portfolio/portfolio'; 404 page not found... - El Forum - 07-31-2011 [eluser]John_Betong_002[/eluser] Try replacing this code: Code: // Old code 404 page not found... - El Forum - 08-02-2011 [eluser]Ivar89[/eluser] I only use subfolders in Views Model and controller are all in root model and controller folders. The new code Code: public function __construct() 404 page not found... - El Forum - 08-03-2011 [eluser]John_Betong_002[/eluser] Did you manage to solve your problem? What CI version are you using? If the version is 2.0 or later then as mentioned before, you need to extend CI_Controller and not Controller. 404 page not found... - El Forum - 08-03-2011 [eluser]Ivar89[/eluser] I managed to solve it by using a different computer, haha On my own laptop it will still give the error so....I don't know whats wrong really but its not the code I guess... I use v1.7.2 it is pretty old I know, But I started with this and never updated(don't know how yet haha) Bu tI think it is not the code 404 page not found... - El Forum - 08-03-2011 [eluser]Pedro Luz[/eluser] updating to a recent version of CI only takes a little more than 10 minutes 404 page not found... - El Forum - 08-03-2011 [eluser]Ivar89[/eluser] Yhea I really should, but if I do that I have to edit allot, I mean every controller need to be edited to ci_controller and probably some other stuff from which I do not know, so it iwll take a while and I am SWAMPED atm But the rpoblem is my laptop because on my work laptop it works flawlesly 404 page not found... - El Forum - 08-03-2011 [eluser]LuckyFella73[/eluser] Do you have a folder calles "portfolio" in your root/htdocs? If thats the case you will have to change either the folder-name or controller-name ... Afaik you can't have a controller and a folder in your htdocs with the same name (at least if you are using mod-rewrite). |