[Vuejs]-Symfony 3 routes + VueJS's index.html with F5 falls to 404

0👍

You need a wildcard address to point to your Vue.js application. Otherwise when you reload you send a request to Symfony, and it doesn’t know hoy to handle it.

vuejs_wildcard_route:
    defaults:  { _controller: AppBundle:YourController:yourAction }
    path:   /vuejsappbasepath/{whatever}
    requirements:
        whatever: .*
    defaults:
        whatever: null

I have this setup working with a reactjs app and is working perfectly.

YourController is the controller that contains yourAction, the one that loads the template with the Vue.js panel.

Leave a comment