jeudi 6 octobre 2016

What is the best practice to handle friendly urls in Laravel?

We have an online-shop.

We can have any friendly urls as for separate models like products or categories (/iphone-6-white = /iphones/23) as for custom filter urls like (/cool-flashes = /flash?cap=32gb&col=white)

What is the best practice to handle all urls?

IMHO we should create a table where we should store two cols (urlFrom and RedirectUrl). But redirect is not good way for us because we do not want a redirect, we just want to show appropriate content under the urlFrom.

I want to store it in a single table to make just one request to DB to find out whether we have the url or not.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire