Support the ongoing development of Laravel.io →
Configuration

Hey there,

we´re trying to rebuild our company´s website with laravel. At the moment we have some big trouble with our routing.

We need to keep our old URL´s because of SEO reasons, and thats the Problem. We are trying to set a dynamic routing with 3 different cases. Url can be:

  1. http://www.website.com/1203 Here we need to get information from DB an generate the real URL and a redirect to: http://www.website.com/{nav}/{id}/{name} where "nav" could be longer than one! So it could esle be http://www.website.com/{nav}/{nav}/{nav)/{id}/{name} And then we want to use the Product Controller with a showProduct Method.

  2. http://www.website.com/{nav}/{nav} <-- or maybe longer Here we wanna use the Navigation Controller with a showNavigation Method.

  3. http://www.website.com/{nav}/{nav}/{nav)/{id}/{name} <-- e.g. link from an anchor tag Here we wanna use the Product Controller with showProduct directly , without an redirect or URL generating.

We tried almost everything we could find on google or stackoverflow. Are there any special routers out there ?? WE NEED SOME HELP :D

Thanks Marc

Last updated 3 years ago.
0

what do u mean with 'longer' ? {nav}/{nav}/{nav}/{id} ..... multiple same variables/params {nav} ? are they gonna be filled with the same values ?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.