Welcome Guest, Not a member yet? Register   Sign In
Cannot serve index method by default?
#1

How come I cannot serve the index method by default?
I have a controller 'platform' (with an index method) ... when visiting http://localhost:8081/platform I get:
Code:
Not Found
The requested resource
[code]/platform
was not found on this server.[/code]
Even if I specifically add these routes I get the same. Now, I can't for the life of me figure out what the cr... CI is doing to cause this.
PHP Code:
$routes->add('platform''Platform::index');
$routes->get('/platform''Platform::index'); 
Anyone have any idea how to fix this?
Reply
#2

OK, to answer myself in the future.
I had renamed a folder inside the public folder to 'platform' to separate assets. And that kicked me!
So CI obviously serve whatever /urlpath from the /public folder before checking for at controller of that name ... I guess that's a feature (and probably makes sense). But I simply wasn't aware of that ... and therefore spent a decent amount of time figuring this out.
So: DON'T have a path in your public folder that matches ANY routes. Unless of course, you want to ; )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB