Skip to content

Instantly share code, notes, and snippets.

@JackPoint
Last active December 17, 2015 17:59
Show Gist options
  • Save JackPoint/5650323 to your computer and use it in GitHub Desktop.
Save JackPoint/5650323 to your computer and use it in GitHub Desktop.
Laravel remove trailing slash
Route::get('{any}', function($url){
return Redirect::to(mb_substr($url, 0, -1), 301);
})->where('any', '(.*)\/$');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment