CodeIgniter Forums
SOLVED - Routing works but also gives apache 404 error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: SOLVED - Routing works but also gives apache 404 error (/thread-44263.html)



SOLVED - Routing works but also gives apache 404 error - El Forum - 08-09-2011

[eluser]DrDave[/eluser]
I have a custom route defined in my application so that "http://www.site.com/details/id" is routed to the details controller, index method like so:

Code:
$route['details/(:num)'] = "details/index/$1";

It works just fine, but I noticed that my apache error log is filling up with 404's stating that /path/to/details doesn't exist.

I checked in firebug, and it is 404'ing on the id. For example if I enter "http://www.site.com/details/50" it tries to get "50" and can't find it, yet the page still loads fine and everything works.

Has anyone run across this before? Any suggestions on how I can stop it?

Thanks!


SOLVED - Routing works but also gives apache 404 error - El Forum - 08-09-2011

[eluser]DrDave[/eluser]
I did further checking because I have other routes defined, and none of them cause the apache 404 error, and they appear to be set up in an identical way.

For example:

Code:
$route['category/(:any)'] = "listings/display_listings/$1";

When I visit "http://www.site.com/category/automotive" it tries to GET "automotive" and succeeds - no 404. I'm totally baffled!


SOLVED - Routing works but also gives apache 404 error - El Forum - 08-09-2011

[eluser]DrDave[/eluser]
I found the problem. I had something in my .htaccess which was causing a conflict with an install of wordpress in a subfolder.