2013-12-16 59 views
1

我怎麼能重定向與routes.php或htaccess的網址?我怎麼能重定向與routes.php或htaccess的網址?

我的主頁:

teszt.hu/onecontroller/oneaction/ 
teszt.hu/categories/index/ 

而重定向:

teszt.hu/specword/categories/index/ => teszt.hu/categories/index/?s=specword 
teszt.hu/specword/onecontroller/oneaction/ => teszt.hu/onecontroller/oneaction/?s=specword 

回答

0
$accWebpages = '(webpage1|webpage2|specword)'; 

//Router::connect('/:accwebpage/:controller/:action', array(), array('pass' => array('accwebpage'), 'accwebpage' => $accWebpages)); 

Router::connect('/:accwebpage/', array('controller' => 'homes', 'action' => 'index'), array('pass' => array('accwebpage'), 'accwebpage' => $accWebpages)); 

Router::connect('/kategoria/:page/:category-:slug', array('controller' => 'products', 'action' => 'index'), array('pass'=>array('page', 'category', 'slug'), 'page' => '[0-9]+', 'category' => '[0-9]+')); 
Router::connect('/:accwebpage/kategoria/:page/:category-:slug', array('controller' => 'products', 'action' => 'index'), array('pass'=>array('page', 'category', 'slug', 'accwebpage'), 'page' => '[0-9]+', 'category' => '[0-9]+', 'accwebpage' => $accWebpages)); 
...