Another 404 Not Found |
[eluser]gmonfort[/eluser]
Hello everybody, I'm new to CI, I like the framework and want to use it but I have some problems trying to set it up. After a fresh installation, downloaded the CI files and put them in a folder in my webserver document root, try to access the default controller (welcome) and get a 404 Not Found page. Problem description: http://localhost/CodeIgniter/ --> welcome screen (welcome view) http://localhost/CodeIgniter/index --> welcome screen http://localhost/CodeIgniter/index.php --> welcome screen http://localhost/CodeIgniter/welcome --> Not Found Creating a new controller to test as suggested in the forums: Code: class Home extends Controller { http://localhost/CodeIgniter/index.php/home --> welcome screen http://localhost/CodeIgniter/index.php?home --> get Test (works) http://localhost/CodeIgniter/index.php?/home --> get Test (works) All of this is with default installation config file: Code: // Config After changing 'uri_protocol' or 'index_page' same results but these changes: With $config['index_page'] = "index.php?"; http://localhost/CodeIgniter/index.php/home --> now I get test (works) Changing $config['uri_protocol'] = "AUTO"; doesn't seem to change anything. These are my system details: Linux debian 2.6.24-1-amd64 PHP Version 5.2.5-3 Apache/2.2.8 CodeIgniter 1.6.1 Any help would be very much appreciated.
[eluser]Hermawan Haryanto[/eluser]
Why don't you take a quick look at the file /config/routes.php ? Cheers, Hermawan Haryanto
[eluser]gmonfort[/eluser]
[quote author="Hermawan Haryanto" date="1209855464"]Why don't you take a quick look at the file /config/routes.php ? Cheers, Hermawan Haryanto[/quote] Well if I change the default controller to my 'home' controller, then http://localhost/CodeIgniter/ --> renders 'test' (works as expected) http://localhost/CodeIgniter/home --> Not Found http://localhost/CodeIgniter/welcome --> Not Found Seems like there's a problem whith the 'controller-from-url' mapping.
[eluser]m4rw3r[/eluser]
Then your controller name should be appended after index.php: http://localhost/CodeIgniter/index.php/controller http://localhost/CodeIgniter/index.php/home On how to add a rewrite to htaccess: search the forum, check the wiki and manual.
[eluser]gmonfort[/eluser]
Thanks for your reply m4rw3r and Hermawan Haryanto. Actually if I use index.php/controller and set $config['index_page'] = "index.php?"; it works as it should http://localhost/CodeIgniter/index.php/welcome but isn't there a way to omit the index.php?
[eluser]gmonfort[/eluser]
Ok I will look into that, thanks a lot for your help.
[eluser]gmonfort[/eluser]
Excellent everything is working now with mod_rewrite, thanks again |
Welcome Guest, Not a member yet? Register Sign In |