![]() |
Tutorial - Static Pages - 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: Tutorial - Static Pages (/showthread.php?tid=48687) Pages:
1
2
|
Tutorial - Static Pages - El Forum - 01-24-2012 [eluser]Tybion[/eluser] I relocated the application and system folders above the root of the web server as suggested in the CodeIgniter Installation Instructions. As a raw CodeIgniter beginner, I am now running the Static Pages tutorial. After I had created the first few files, the URL index.php/pages/view kept returning Page Not Found. After a fair bit of research, I changed the code in pages.php to .. Code: if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) { The tutorial now works. The code in the tutorial is currently .. Code: if ( ! file_exists('application/views/pages/'.$page.'.php')) { Or is there an even better way to make sure the tutorial works in all cases? Tutorial - Static Pages - El Forum - 01-25-2012 [eluser]jjDeveloper[/eluser] Did you change the paths to your system and application folder in codeigniters index.php file? Tutorial - Static Pages - El Forum - 01-25-2012 [eluser]Tybion[/eluser] Yes - to 'C:/CI/applications' and 'C:/CI/system' That is why APPPATH is set to the new (correct) location rather than the original location. Tutorial - Static Pages - El Forum - 01-25-2012 [eluser]CroNiX[/eluser] I submitted a correction on github. Tutorial - Static Pages - El Forum - 01-25-2012 [eluser]Phil Sturgeon[/eluser] And it has been merged! Thanks for the fix guys. Tutorial - Static Pages - El Forum - 02-20-2012 [eluser]desertprincess[/eluser] Thanks...that fixed it. But I am stuck on the routes.php thing. Not sure if I should do this in routes.php or .htaccess with mod_rewrite. I am trying to rewrite/reroute the url www.myurl.com/pages/views/about to www.myurl.com/about without messing up other applications. In routes.php I have: Code: $route['default_controller'] = 'news'; In .htaccess I have this one that I found: Code: <IfModule mod_rewrite.c> Tutorial - Static Pages - El Forum - 02-20-2012 [eluser]CroNiX[/eluser] How many pages do you have like this? If not too many, you can list them all in a single route. There are many ways to do this. Just one page... Code: $route['about'] = 'pages/view/$1'; Multiple pages... Code: $route['(about|some-other-page)'] = 'pages/view/$1'; Code: class Pages extends CI_Controller { Tutorial - Static Pages - El Forum - 02-20-2012 [eluser]desertprincess[/eluser] I have multiple pages, but I am thinking that it might be better to just not put them in the pages folder if it means adding an extra configuration. Tutorial - Static Pages - El Forum - 02-20-2012 [eluser]msAdele[/eluser] I'm learning a lot from the posts. Little by little, I hope I get to improve myself. Thanks, everyone! Tutorial - Static Pages - El Forum - 03-27-2012 [eluser]igniter_guest[/eluser] I am running through the 'Tutorial − Static pages' and I am having a problem on the first page! I have followed the instructions in detail and all I get is error 404. I included the APPPATH suggestion above but still no joy. I am not having any joy with the documentation/tutorials on this site, anybody know of what might be wrong on the Static Pages tutorial? Thanks in advance, Jason |