the path defined in the route is not correct symfony

孤街浪徒 提交于 2019-12-13 03:53:11

问题


I try to redirect to a route after the succes of my form.. In dev it works perfectly

my html:

<input type="hidden" name="_target_path" value="{{ path('homepage') }}" />

my router:

homepage:
    path: /homepage
    defaults: { _controller: 'App\Controller\HomePageController::hello' }

I am redirected to :

http://localhost:8000/homepage

The problem is that in prod environment

I am redirected to: https://mydomain.fr/mywebsite/public/mywebsite/public/homepage

What I have to do in prod to be redirected to https://mydomain.fr/mywebsite/public/homepage

For info I use the webserver provided by symfony in local http://localhost:8000/

Thanks in advance for your help.


回答1:


Put your project in the same dir as public_html as a sibling. Then remove the public_html dir and recreate it as a symlink pointing to your project public dir. then make sure you install Apache-pack bundle it will create the .htaccess file and you should be good. Worked for me on A2host



来源:https://stackoverflow.com/questions/48964316/the-path-defined-in-the-route-is-not-correct-symfony

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!