0
votes

I am using annotations to generate my routes with Symfony2.3. My routes work perfectly fine in dev environment, but the server gives me 404 when I try to access them in prod. I have warmed up and cleared my cache several times to no result. I am totally lost. I don't understand why everything works fine in dev, but not in prod.

Anyone has an idea ?

Edit : This is app/config/routing.yml

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

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

And this is 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

Thanks

1
What is the content of both your routing files?Jivan
I edited the message to add the content of the routing filesH.novaway
I would try to put the whole content of routing_dev.yml into routing.yml, just to try if is a problem of the routing file. Did you try it?Gianni Alessandro
Yes thank you i'll try that. But i noticed that the routes work fine with internationalization. for example, all the routes work with www.mydomain.com/en. I probably messed up when changing something about that.H.novaway

1 Answers

0
votes

check if you have set up to use apache rewrites in your config_prod.yml like this

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

if so, then you might need to regenerate your routes.