Welcome Guest, Not a member yet? Register   Sign In
Incorrect uri string - /index.php/error/500.html
#1

[eluser]coffeeandcode[/eluser]
Hi all, I'm having a very strange problem.

I have been working on a code igniter application all day, and suddenly experienced this error, when I wasn't editing anything that should be remotely related.

The setup I have includes a parent controller with a _remap function. Many of the section landing pages on the site use the same template, so by default the parent index function is called.

I was working on something unrelated to routing and the system setup, and went to test my work and suddenly I'm getting 404's for many of my landing pages. I can't seem to find a pattern for which ones work and which ones don't. Most of the internal pages seem to work fine.

I tracked down the issue and it appears that there is something odd going on with my $_SERVER variables.. it shows the path as being "/index.php/error/500.html". Code igniter thinks the segments are "error" and "500.html", and throws a 404 because it can't find the controller.

Any ideas? This happened very suddenly, and again, it doesn't get to any of my code, so I'm kind of at a loss.

Thanks for any help, let me know if more information is needed.
#2

[eluser]KingSkippus[/eluser]
Dumb question, did your .htaccess, if you have one, get modified?
#3

[eluser]coffeeandcode[/eluser]
[quote author="KingSkippus" date="1279788361"]Dumb question, did your .htaccess, if you have one, get modified?[/quote]

I wish it were that simple, I checked that already. I have one rule to get rid of index.php, and a list of exceptions for my images, css, etc. I added "error" to the list, and the normal 500 server error message appears. I changed it back because that doesn't help much. That's the only change I've made to it since I set it up about a month ago.

I feel like (read: hope) that it's just some dumb error that has a quick and easy fix. But I'm not so sure. The $_SERVER variables are delivering an error message.. that seems to be a bigger problem :-S
#4

[eluser]coffeeandcode[/eluser]
Alright, I figured it out. Updating here for the sake of anyone finding this through a search.

It was a stupid error, as I had hoped. I have a content model that handles things that don't make sense as data - items for a carousel, a list of banners, etc. I was putting everything in the same model, and it started to get unwieldy, so I used the content model as a front end to other models - one for banners, one for carousel items, etc.

So in my controller I did:

Code:
$banners = $this->content->banners($section)

And in the content model I had:

Code:
function banners($section) {
    return $this->banners($section);
}

When I should have had:

Code:
function banners($section) {
    return $this->banners->get($section);
}

Instead of requesting the content from the banners model, I was calling the banners method again and again. Infinite recursion. So, it was my fault Confusedhut:

Out of curiosity though, should CI be able to handle this better and produce a more helpful error message? Or is it the kind of situation where it has no way of knowing about the error? It seems like having /error/500.html in the uri string would provide a way to handle it....

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB