|
||||
|
Hello,
I am very concern about SEO things for some websites and i am wondering what can do ZF for us. This is in fact the main reason for which i didn't switched to ZF MVC totally... Because i didn't found out a workaround for Controller side... One problem i consider important is URL format. Sample: Rather than focusing over URL format as: /news/view/73 .... I personally prefer to use a totally different format as: /This-is-the-news-title-19_73 where: * "This-is-the-news-title" is news title * 19 is page identifier (each page having his own id); i think standard Zf format (controller-view) is not always the best approach * 73 is news identifier... Why ? Because: * is not a good idea to use a file into a directory, a file directly into root is ranked better by SE than one file under /onedire/subdir/subdir/filename * using a filename format URL friendly helps on SE rankings: "This-is-the-news-title" * because using "news" word means "news" is getting SEO exposure, and i don't want this, instead a number is filtered by SE so doesn't get exposure So, i am wondering if there are any possibilities to work with controller side this way, more SEO friendly... Because standard controller doesn't help much...
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter |
|
||||
|
simple just create a custom router
![]()
__________________
Zym Framework - A Zend Framework extension library w/ demo app SpotSec Blog: http://spotsec.com/blog |
|
||||
|
You mean a implementation of:
Zend_Controller_Router_Route_Interface ? I was able to partially solve problem by adding: //added... $router = $frontController->getRouter(); // returns a rewrite router by default $router->removeDefaultRoutes(); $router->addRoute( 'user', new Zend_Controller_Router_Route(':anytext_:controller _:action') ); Format is still not what i wanted but anyway... More closer...
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter |
|
||||
|
Inorder to get the format you want you will probably have to use some regex expressions to parse out the path and create a route
__________________
Zym Framework - A Zend Framework extension library w/ demo app SpotSec Blog: http://spotsec.com/blog |
|
||||
|
On index.php
PHP Code:
On config.ini [general] routes.index.route = ":seo_:controller_:action" routes.index.defaults.controller = index routes.index.defaults.action = index I am not totally sure is 100% fine didn't tested very much... I tested constructing directly route not from .ini
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter Last edited by SpotSec : 05-02-2007 at 06:01 AM. Reason: Added php tags |
|
|||
|
I'm new to this custom router thing and since documentation/end-user/core/en/zend.controller.router.html confuses me, could you give me some links where I can get an enlightment
Thanks! Last edited by Tommy1402 : 06-15-2007 at 06:40 AM. |
|
||||
|
Well, I'm not sure there are any links right now that talk about writing your own routers, but if you are going down this path, I'm sure there are a few people lurking around this forum that can help you out. There are several other knowledgeable people in the irc channel if you want to chat.
__________________
Zym Framework - A Zend Framework extension library w/ demo app SpotSec Blog: http://spotsec.com/blog |
![]() |
| Thread Tools | |
| Display Modes | |
|
|