basic CI codes |
Hello,
I still wonder why: http://localhost/blog/ 404 Page Not Found The page you requested was not found. views/blog.php PHP Code: <html> controllers/blog.php PHP Code: <?php routes.php PHP Code: $route['404_override'] = ''; Which code do I need to fix?
" If I looks more intelligence please increase my reputation."
Make a basic html file called home.html
Does your local host find that file? If not it is probably not a CI problem Usually you connect via something like localhost/index.php/blog If you have removed index.php then you have probably not done something correct there with .htaccess PHP Code: $route['404_override'] = ''; *** Place wildcards at the bottom *** *** $route['blog'] = 'blog/index'; *** $route['blog/(:any)'] = 'blog/view/$1'; *** $route['(:any)'] = 'pages/view/$1';
Keep calm.
CI 3.X Documentation default controller:
This route points to the action that should be executed if the URI contains no data, which will be the case when people load your root URL. The setting accepts a controller/method value and index() would be the default method if you don’t specify one. In the above example, it is Welcome::index() that would be called. Note You can NOT use a directory as a part of this setting! What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
what he is saying is change this
$route['default_controller'] = 'pages/view'; to something like $route['default_controller'] = 'defaultview'; or whatever you want the controller to be called . the default controller can not be in a folder, it has to be at top level
Do you have htaccess in place to remove the index.php from your route? Sounds like you don't or it's not setup correctly. Try http://localhost/index.php/blog and see if that works. If it does, you need to remove the index.php from the URI.
|
Welcome Guest, Not a member yet? Register Sign In |