L
L
leo_fr2015-11-06 13:24:36
symfony
leo_fr, 2015-11-06 13:24:36

Symfony gives a 404 error when updating the URL, what could be the reason for this problem?

Index page
0c5034a3e3244540b46ef08e728eaf77.jpg
For example, I want to reload this page
a4203e016d6c4ae08cb742881ed14124.png
. An error pops up that there is no page.
dcf7250bc6e74f8e82a2b10c1f8ebccc.png
Then I delete / home
6344c4ba28d54abb97de38acd9cc52ad.png
and update this path
bf613139c5de4a428394a09ac6dca71b.png
. As a result, the page is loaded normally + / home is added
0c5034a3e3244540b46ef08e728eaf77.jpg
.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Romanenko, 2015-11-06
@slimus

Show what will give:
Most likely the route is incorrectly described

P
Pavel Hudinsky, 2015-12-19
@myLizzarD

You need to add a route to symphony that will match the /home url and specify the controller and action for it as for your index route. Something like:
my_application_home_page:
path: /home
defaults: { _controller: MyBundle:IndexController:index }
and for all urls that should be processed by your angular - create appropriate routes in symphony that will call the same action - indexAction of your controller. Thus, after reloading the page, your index controller will be called at any url, and Angular will pick up the url on the fly and call the desired Angular controller

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question