简体   繁体   中英

Rewrite Url Zend

My site is on Zendframework made. I need a little help with rewrite the url. I have for example this url http://www.familymoments.de/category/Weihnachtskarten and now I what to rewrite it without "category", to this url http://www.familymoments.de/Weihnachtskarten . how can I do this one? Thx

You can use custom routes. Add this to bootstrap:

  //create new route
  $routes['Weihnachtskarten'] = new Zend_Controller_Router_Route(
          '/Weihnachtskarten',
          array(
              'module'=>'default',
              'controller'=>'category',
              'action'=>'weihnachtskarten',
          ));

  //add it to router
  $router = Zend_Controller_Front::getInstance()->getRouter();
  $router->addRoutes($routes);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM