Jump to content

Recommended Posts

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.

 

 

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.