samedi 16 juin 2018

Route::redirect with a custom url ( /products/{name} )

I want to redirect all "gets" from "/products/PRODUCTNAME" to "/product/PRODUCTNAME". I tried to do it with Route::redirect:

Route::redirect('/products/{name}', '/product/{name}');

But, if I go to "mypage.com/products/HJ-3000" it's supposed to redirects me to "mypage.com/product/HJ-3000", but I get, textually, "mypage.com/products/{name}".

I know I can do it with Route::get, but I want to know how can I do it with Route::redirect.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire