title: Rewriting route closure 301 redirects into controllers in Laravel
body: <p>I have implemented 301 redirect in Laravel 5.5+ web.php for some pdf files, e.g.</p>
  
  <pre><code>Route::get(
      'old-url.pdf', function () {
      return Redirect::to('new-url.pdf', 301);
  });
  </code></pre>
  
  <p>It works great on a dev environment.</p>
  
  <p>However, when deployed on the production site, due to caching (caching doesn't allow serialization of closures), I get errors such as</p>
  
  <pre><code>LogicException: Noticed exception 'LogicException' with message 'Unable to prepare route [old-url.pdf] for serialization. Uses Closure.' in /XXX/vendor/laravel/framework/src/Illuminate/Routing/Route.php:880
  </code></pre>
  
  <p>I am looking for an example on how to re-write the redirect above using controllers (or any other recommended method)</p>