Welcome Guest, Not a member yet? Register   Sign In
Custom 404 handling
#11

[eluser]markup2go[/eluser]
Hey thanks for your contribution Mark. I'm using this in all my current projects without any issues so far.
#12

[eluser]Bluemill Media[/eluser]
This is useful, and similar to a method I've been using for a while..

However, for some unknown reason, auto-loaded libraries don't seem to work when the error controller is shown for a non-existing method.. Has anybody else had this problem? (And hopefully a solution?)
#13

[eluser]waterloomatt[/eluser]
Works like a charm - thanks.
#14

[eluser]Mark van der Walle[/eluser]
I just got an e-mail from someone asking for help with this. I did not realise alot of people are using this. I can at least point to a significant flaw in my code. It is as Bluemill posted, when a non-existing method is called on an existing controller.

The problem is that the controller IS the Codeigniter object and in this case a new controller is created without all the models, libraries and other stuff you already should have in the controller. My code was written to get 404's working without hacking the CI core.

The only way to have all your libs and models is to copy them over. Mostly the only thing I needed in my errorhandler was a database object. Perhaps Ill look into modifying the code a bit to allow for all libraries and models to be available.
#15

[eluser]Set[/eluser]
Hello!
I've got a Problem. on my local server, everything works fine, but on the provider's server code does not work. shows a standard error page 404. tell me where to look.
#16

[eluser]Mark van der Walle[/eluser]
Do you perhaps use windows for local development and Linux/Unix on the server? I ran into this with someone else a while back, because windows uses case insensitive paths and filenames whereas Linux/Unix does not.
#17

[eluser]Set[/eluser]
exactly. and what can I do in this situation? Smile
#18

[eluser]Mark van der Walle[/eluser]
Make sure the filenames are written in the correct case:
MY_Controller
MY_Router

That should solve it.
#19

[eluser]Set[/eluser]
fun.
it was
MY_controller
MY_router
ErrorHandler

but the situation is not changed.




Theme © iAndrew 2016 - Forum software by © MyBB