Tutorial - Static Pages |
[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?
[eluser]jjDeveloper[/eluser]
Did you change the paths to your system and application folder in codeigniters index.php file?
[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.
[eluser]Phil Sturgeon[/eluser]
And it has been merged! Thanks for the fix guys.
[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>
[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 {
[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.
[eluser]msAdele[/eluser]
I'm learning a lot from the posts. Little by little, I hope I get to improve myself. Thanks, everyone!
[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 |
Welcome Guest, Not a member yet? Register Sign In |