Issue
How could I redirect an url with routes.php or htaccess?
My homepage:
teszt.hu/onecontroller/oneaction/
teszt.hu/categories/index/
And the redirect:
teszt.hu/specword/categories/index/ => teszt.hu/categories/index/?s=specword
teszt.hu/specword/onecontroller/oneaction/ => teszt.hu/onecontroller/oneaction/?s=specword
Solution
$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));
...
Answered By - Zimányi Gábor Answer Checked By - Mary Flores (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.