Welcome Guest, Not a member yet? Register   Sign In
Tutorial - Static Pages - about.php page showing 404 error
#1

[eluser]osxxso[/eluser]
Followed the instruction... user_guide/tutorial/static_pages.html

running xampp ( http://site.local)

When I got to http://site.local ( i see header.php, home.php, and footer.php )

When I go to http://site.local/about ( i get Error 404 )

When I go to http://site.local/index.php/about ( I see header.php, about.php and footer.php )

What do I need to change to see about at http://site.local/about ?

Bye the way, my application and system directories were renamed ( just so I know how to do this ) and placed above root ( additional security ).

index.php

Code:
$system_path = '../sysdir';
$application_folder = '../appdir';

routes.php

Code:
$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';

pages.php

Code:
<?php

class Pages extends CI_Controller {

public function view($page = 'home')
{
  if ( ! file_exists('../appdir/views/pages/'.$page.'.php'))
  {
   // Whoops, we don't have a page for that!
   show_404();
  };
  
  $data['title'] = ucfirst($page); // Capitalize the first letter
  
  $this->load->view('templates/header', $data);
  $this->load->view('pages/'.$page, $data);
  $this->load->view('templates/footer', $data);  
}
}

Thanks in advance!


Messages In This Thread
Tutorial - Static Pages - about.php page showing 404 error - by El Forum - 04-12-2012, 12:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB