Default controller is always loaded event the URL |
[eluser]zerofook[/eluser]
Hello guys. I'm new to CodeIgniter. I downloaded the latest version(2.1.0) of the CodeIgniter framework. Now I'm testing the framework, but I was stuck with an url issue. I'm using Ubuntu 12.04 and apache2 server. My application is stored in /var/www/fleezor folder. The problem is that if I request http://localhost/fleezor I'm getting the main controller view, which is the correct behaviour, but if I request http://localhost/fleezor/test/index (ot http://localhost/fleezor/index.php/test/index) I'm redirected again to the default_controller page (the "main" controller). I was made all of the needed configurations. My configurations are: conf.php Quote:$config['base_url'] = 'http://localhost/fleezor/'; httpd.conf Quote:<Directory "/var/www/fleezor"> .htaccess Quote:<IfModule mod_rewrite.c> routes.php Quote:$route['default_controller'] = "main"; P.S. The code in the test controller is working properly. I have tested it if I switch the default_controller to be "test". Please HELP me !!! Regards, Lubo.
[eluser]InsiteFX[/eluser]
If you are keying it in on the browser do not add the /index on the end of it. Code: http://localhost/fleezor/test Controllers default to running the index method.
[eluser]zerofook[/eluser]
[quote author="InsiteFX" date="1338244499"]If you are keying it in on the browser do not add the /index on the end of it. Code: http://localhost/fleezor/test Controllers default to running the index method. [/quote] I tried this -> same problem.
[eluser]InsiteFX[/eluser]
You must have something else wrong in another place because that should work, Try remove your .htaccess file and see if it works!
[eluser]zerofook[/eluser]
[quote author="InsiteFX" date="1338245343"]You must have something else wrong in another place because that should work, Try remove your .htaccess file and see if it works! [/quote] I renamed the .htaccess file and the same problem occured. This time I have to access the url like this localhost/fleezor/index.php/test, beacuse of the removed .htaccess file, haven`t I ?
[eluser]InsiteFX[/eluser]
Yes you need to add the index.php back into the config or add it to the link.
[eluser]gRoberts[/eluser]
Code: <IfModule !mod_rewrite.c> The above "could" be the cause. If you remove this temporarily, does it work?
[eluser]zerofook[/eluser]
[quote author="gRoberts" date="1338289782"] Code: <IfModule !mod_rewrite.c> The above "could" be the cause. If you remove this temporarily, does it work?[/quote] I was removed the .htaccess file, but now I tried with it. I removed this tag, but again it's not working. Is it possible the problem to be in the apache2 server ?
[eluser]Aken[/eluser]
Try changing your uri_protocol item in application/config/config.php |
Welcome Guest, Not a member yet? Register Sign In |