Hi guys,
I want to redirect to / if a given article is not existent in database. I added
a route for "index/index" and thought if I redirect to / it is the same as
/index/index, but it isn´t. I have to add routes for /, /index and /index/index.
I don´t think this is correct. I am using my own router
(Flabben_Controller_Router_Database extends Zend_Controller_Router_Rewrite)
which fetchs the routes stored in database and add them to the router via
addRoute().
Here (http://www.paste2.org/p/15565, it isn´t final yet!) you can see my actual
database based router and here (http://www.paste2.org/p/15566) how I am using
it. var_dump'd router http://www.paste2.org/p/15567.
I have two routes in my database:
name=index {
module: null
controller: article
action: index
route: index/index
}
name=showArticle {
module: null
controller: article
action: index
route: article/:id/:title
}
My ArticleController::indexAction() selects the requested article from database
(Zend_Db_Table) and if current() returns NULL I redirect to /
($this->_redirect('/')) but then my page is without content. The same if I
redirect to /index. Only if I redirect to /index/index I get the latest article.
Where is my mistake? Why is / != /index != /index/index?
-- Jan