带有注释的路由在prod Symfony2中不起作用

时间:2014-02-02 14:50:36

标签: symfony routing annotations production-environment

我正在使用注释来使用Symfony2.3生成我的路由。 我的路由在开发环境中工作得非常好,但是当我尝试在prod中访问它时,服务器给了我404。 我已经热身并且多次清理我的缓存而没有结果。我完全迷失了。我不明白为什么一切都在dev中工作正常,但不是在prod。

有人有想法吗?

编辑: 这是app / config / routing.yml

hakim_admin:
    resource: "@HakimAdminBundle/Controller"
    type:     annotation
    prefix:   /

hakim_resume:
    resource: "@HakimResumeBundle/Controller"
    type:     annotation
    prefix:   /

这是app / config / routing_dev.yml

_wdt:
    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
    prefix:   /_wdt

_profiler:
    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
    prefix:   /_profiler

_configurator:
    resource: "@SensioDistributionBundle/Resources/config/routing/webconfigurator.xml"
    prefix:   /_configurator

_main:
    resource: routing.yml

JMSTranslationBundle_ui:
    resource: @JMSTranslationBundle/Controller/
    type:     annotation
    prefix:   /_trans

由于

1 个答案:

答案 0 :(得分:0)

检查你是否已经设置在config_prod.yml中使用apache重写

parameters:
    router.options.matcher.cache_class: ~ # disable router cache
    router.options.matcher_class: Symfony\Component\Routing\Matcher\ApacheUrlMatcher

如果是,那么您可能需要重新生成路线。