0

With a codeigniter codebase I've inherited, I'm attempting to get url routing up and running but it only seems to throw 404 errors.

When I go to http://root_url/index.php it hits the default controller/method just fine, however when I request any specifically controller/action, it 404s.

If I request http://root_url/index.php/auth/login apache throws

File does not exist: /var/www/ci_project/index.php/auth/login, referer: http://root_url/index.php

It looks like apache is trying to request a folder that obviously doesn't exist instead of supplying the uri segments of auth/login to the index.php

Notes:

  • I'm not using any htaccess file(the codebase should work without one)
  • mod_rewrite is enabled and is detected by php though I suspect the problem is occuring before hitting php
  • I'm using debian(w/ apache 2.2.2) as opposed to ubuntu(2.2.14) where it does work
  • Query string arguments work fine, it's just the URI segments
  • I'm not attempting to remove index.php, just get the basic controller url matching working
4
  • can you share your controller and config file. Commented Jul 4, 2013 at 14:54
  • The controller file is simply the default config.php and the controller is simply the welcome controller. So with a new codeigniter install root_url/index.php/welcome will fail. I believe this is something to do with apache's resolution of arguments with forward-slash in it. Commented Jul 4, 2013 at 15:23
  • Try adding a ? into the url, making it http://root_url/index.php?/auth/login Commented Jul 4, 2013 at 20:03
  • I think , you did wrong placement for Tank Auth library. Commented Jul 5, 2013 at 5:28

1 Answer 1

1

It actually turned out to be an apache configuration issue on debian and nothing particularly to do with codeigniter at all.

I did a purge/re-install of apache and that appeared to fix the issue.

sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common
sudo apt-get autoremove --purge
sudo apt-get install apache2
sudo apt-get install libapache2-mod-php5

My only guess as to why the problem occured is that I had the libapache2-mod-php5filter(which I didn't realise till purging occured) instead of the libapache2-mod-php5 package installed and it simply didn't handle the urls correctly.

Thanks for the help.

Sign up to request clarification or add additional context in comments.

1 Comment

It actually turns out, it seems to be an issue installed the latest versions of apache. Simply running sudo apt-get install libapache2-mod-php5 seems to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.