4 years ago

Preserving old slugs

Posted 4 years ago by ixudra

Hi all

I'm converting an old app to Laravel 5. This old app uses slugs to direct the user to certain pages. Sadly, these slugs need to remain functional because of SEO purposes. I'm trying to recreate these slugs in my routes but am unable to do so. Below is my code

Route::pattern('id', '[0-9]+');
Route::pattern('old-slug', '[a-zA-Z\_\-()]+');

Route::group(array(), function()
    Route::get(     '',                array('as' => 'index',          'uses' => 'HomeController@index'));
    Route::get(     '{old-slug}',      array('as' => 'slug',           'uses' => 'HomeController@slug'));

Some slugs are the following:


Any thoughts on how I can fix this?

Please sign in or create an account to participate in this conversation.