Kiwwito

Code Snippets and More

Redirect from a route to another with a 301 status code (moved permanently) is as easy as

redirect_from:
    pattern: /
    defaults:
        _controller: FrameworkBundle:Redirect:redirect
        route: redirect_to
        permanent: true

redirect_to:
    pattern: /redirect
    defaults: { _controller: Bundle:Controller:action }

That means, when you enter root you'll be redirected to /redirect

Recent comments

© 2014 Copyright by Keyvan Akbary