3

I'm using Codeigniter for my website, the root website works just fine which has a landing page, however I have a development section located /var/www/domain.com/www/dev/ which /var/www/domain.com/www/ is the root (landing page is stored there).

Now, when I go to domain.com/dev, my codeigniter website works fine, but when I load an controller, e.g. domain.com/index.php/search it gives me an 404 error.

In the error logs of domain.com it shows this:

2011/10/02 02:03:37 [error] 17042#0: *568 open() "/var/www/domain.com/www/dev/index.php/search" failed (20: Not a directory), client: xx.xx.xx.xx, server: domain.com, request: "GET /dev/$

Now I have no complete idea why it's doing this and how to resolve this issue. How can I stop this and also remove the "index.php" remove the URL because Codeigniter tutorials only contain apache's rewriterule which isn't valid on nginx.

1 Answer 1

4

I believe that codeigniter uses the front-controller pattern, which will redirect all requests to index.php using a rewrite rule.

As the rewrite rules are for apache and not nginx, the server is actually looking for a directory called search which lives under another directory called index.php and so on.

I don't have much experience when it comes to nginx, but I believe this blog post can help you come up with rewrite rules on nginx.

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.