.htaccess 如何使用routes.php或htaccess重定向url?

.htaccess 如何使用routes.php或htaccess重定向url?,.htaccess,cakephp,cakephp-2.3,.htaccess,Cakephp,Cakephp 2.3,如何使用routes.php或htaccess重定向url 我的主页: 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/onecont

如何使用routes.php或htaccess重定向url

我的主页:

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
你应该用这个

请在此处阅读有关路线的更多信息:

在我的脑海里,我想应该是这样的:

Router::connect(
    '/specword/:controller/:action',
    array('?' => array('s'=>'specword')),
);
$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));
...