Question: I am new in laravel framework now I'm working fully developed website using Laravel. I have changed blog url form {id} to {id}/{name} like www.example.com/news/203 to www.example.com/news/203/title. It's working fine. but i need to redirect if old url enter into current url opened from cache or something else.

```
Route::get('{id}/{name}', 'EventController@show')
            ->name('events-detail')
            ->where([
                "id" => "[0-9]+"
    ]);

```

Answer: 
You can define another route in which you will find the model by id and use its title to redirect the user to the new route:

```
Route::get('{id}', function ($id) {
    $model = Model::findOrFail($id);

    return redirect()->route('events-detail', ['id' => $id, 'name' => $model->name]);
});

```

Note that you have to change `Model` with the class you use for this route.
I'm assuming the `name` portion is not really used at all, except for SEO/friendlier urls. If this is the case, just make the `name` parameter optional, and there will be no need for a redirect:

```
Route::get('{id}/{name?}', 'EventController@show')
    ->name('events-detail')
    ->where([
        "id" => "[0-9]+"
    ]);

```

This route will match `/203` and `/203/news-title`.