TonyGotSkilz Posted December 4, 2009 Share Posted December 4, 2009 First let me say I'm working on a very private site so posting code is out except for general stuff already found in Zend. With that said I need help setting up Custom 404 handling. I have the normal zend error controller setup currently and it works, I get a generic 404 page. What I'd like is to customize that 404 page without redirecting traffic for SEO purposes. The problem I'm having is Templating. I can't get my templates to show up using the normal method: $this->view->layout()-> ... This does not work at all in the error controller whereas it works in every other controller. If anyone knows how to get a custom 404 page going without redirecting using routing (which works but is not ideal for SEO) your help will be greatly appreciated. Also if i can clarify the issue any better let me know and i'll try. I'll be checking back frequently. Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/184021-zend-404-error-page-question-templating-issue/ Share on other sites More sharing options...
trq Posted December 5, 2009 Share Posted December 5, 2009 Layouts should work as per usual within your error controller. Quote Link to comment https://forums.phpfreaks.com/topic/184021-zend-404-error-page-question-templating-issue/#findComment-971691 Share on other sites More sharing options...
TonyGotSkilz Posted December 5, 2009 Author Share Posted December 5, 2009 Thats strange. I'm sure they don't. Our setup is quite custom but the error handling is basic zend so I don't see why they all layout commands are totally ignored by our setup. They work in every other controller except the error controller. Quote Link to comment https://forums.phpfreaks.com/topic/184021-zend-404-error-page-question-templating-issue/#findComment-971701 Share on other sites More sharing options...
trq Posted December 5, 2009 Share Posted December 5, 2009 They work in every other controller except the error controller. The error controller is no different to any other controller. We would need to see code to be of more assistance. Quote Link to comment https://forums.phpfreaks.com/topic/184021-zend-404-error-page-question-templating-issue/#findComment-971708 Share on other sites More sharing options...
TonyGotSkilz Posted December 7, 2009 Author Share Posted December 7, 2009 I guess the problem i'm having is with routing. We use an INI file to route. But I can't see a way to route for errors. Our we have an error.phtml page but there is no way (that i can think of) to have errors route to it without redirecting. If i set up the route to catch all wild cards, something like ... (.*)/(.*) the route would catch everything and not just addresses that aren't valid. So that wouldn't work. Somehow we have to get to an actual page when we hit an error instead of a 404 error message. For every other controller, you are connected to a specific page via routing so i guess the real question is how do you set up a route for invalid pages. Does anyone have a custom 404 page on their site, and if so how did they handle it, can someone possible show me their error controller and routing setup for a custom 404 page. If i could see a valid example I could probably extrapolate what i need to do from there. Zend is pretty awesome but the documentation for it is some of the worst i've ever seen. Quote Link to comment https://forums.phpfreaks.com/topic/184021-zend-404-error-page-question-templating-issue/#findComment-973090 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.