Routing issue |
[eluser]garycooper[/eluser]
Hi Everyone, First message here, so first thanks in advance for your welcome I watch and install the source file of shawn videocast (Shawn VideoCast) I edit all config files to make it work on my local pc (config,virtual host, host) When i try the url http://dev.website.local/ i'm redirect to the default controller that's good. But when i try to reach other controller (login, dashboard) i get 404 error. And my 404 error are not displayed with CI 404 template but default browser. I think i've got a routing issue but after 4 hours research i can't find where.... here is my routes.php Code: $route['default_controller'] = "main"; thanks a lot for your help
[eluser]danmontgomery[/eluser]
If you're getting the apache 404 it means the request is never reaching CI. Something awry with your htaccess, are you using one? Are you including index.php in your url?
[eluser]garycooper[/eluser]
here is htaccess file Code: <IfModule mod_rewrite.c> u talk about .htaccess file from default CI directory ?
[eluser]garycooper[/eluser]
when i try http://dev.website.local/index.php/login it works but when i try http://dev.website.local/login i get apache 404...weird
[eluser]danmontgomery[/eluser]
Is there a reason you have nothing after RewriteBase? If your index.php is in webroot you should leave that value as / or remove it completely. There's also really no reason to be mixing rewritebase with absolute paths in your rewriterules (I realize this is something that comes from the wiki) You can also try removing the ? after index.php. Have you looked at apache's error log?
[eluser]garycooper[/eluser]
Code: [Mon Sep 13 11:21:22 2010] [error] [client 127.0.0.1] File does not exist: C:/LocalPagesDirect/admin.test.yyy.com/codeigniter/login Honestly i'm not very good with .htaccess I first used shawn ones Code: RewriteEngine on but i get internal server error on apache so i found the first one on forum Do you have a good .htaccess to recommend me ? thanks
[eluser]garycooper[/eluser]
Finally the original htaccess was good i just add to uncomment this line on http.conf LoadModule rewrite_module modules/mod_rewrite.so problem solved
[eluser]Nalorin[/eluser]
Quote:i just add to uncomment this line on http.conf It's odd that removing the mod_rewrite module would fix a problem with rewriting not happening properly. Quote:when i try http://dev.website.local/index.php/login it works Since the first line works, your codeigniter is working properly. The second one not working means that you don't have the proper rewrite rules (see noctrum's suggestions above - the ? should not be there unless you're using $config['uri_protocol'] = "QUERY_STRING"; If the second line is not working properly, try the uri_protocol "REQUEST_URI", and each of the others, to see if one of them works. Also, check to ensure that in config.php Code: $config['index_page'] = ""; Give those things a shot and see if it makes your URLs much nicer |
Welcome Guest, Not a member yet? Register Sign In |