Symfony routing not working

不想你离开。 提交于 2021-01-27 21:38:53

问题


I am using a normal host (i.e access to web pages via public_html and no access to php (apache) configuration).

so here what i did

  1. renamed my web dir => public_html
  2. renamed app.php (prod application) to index.php

I've also added a route to my page (template) named "littlebird"

Problem

when I call www.mywebsite.com/littlebird => 404 page not found

but when I use www.mywebsite.com/index.php/littlebird every thing works just fine.


回答1:


My original guess was that you didn't have the mod_rewrite turned on.

But during our discussion we've found that you have replaced the original .htaccess with something else.

The original .htaccess could be found by this address: https://github.com/symfony/symfony-standard/blob/master/web/.htaccess




回答2:


It seems to me like you don't have a index.php value within DirectoryIndex.

Try editing your .htaccess file that is located in littlebird and adding/updating it with:

DirectoryIndex index.php index.html


来源:https://stackoverflow.com/questions/20364210/symfony-routing-not-working

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