Closed m-vo closed 7 years ago
Without seeing your code it's hard to tell what you might have done wrong. See also https://community.contao.org/de/showthread.php?66697-AJAX-im-Frontend&p=440081&viewfull=1#post440081
Thanks, my structure looked pretty similar to the one you posted. I just found out it only does not work via the app_dev.php
enty point. Is there a reason for this?
I then like to reframe this as a feature request: :-)
It would be nice if it would be possible to add a custom routing.yml
to the app/config
folder that gets loaded automatically. This would e.g. allow for some simple redirects:
legacy_redirect:
path: /someLegacyPath
defaults:
_controller: FrameworkBundle:Redirect:urlRedirect
path: /someNewPath
permanent: true
Thanks, my structure looked pretty similar to the one you posted. I just found out it only does not work via the app_dev.php enty point. Is there a reason for this?
Have you tried to debug the routes with
./vendor/bin/contao-console debug:router -e=dev
?
(Oh that's a nice tool, I didn't know that!)
The route is listed there right on top for both prod end dev environment. However, when accessing it via app_dev.php
the contao_catch_all route gets selected.
So basically with a custom route of /some/custom/route
:
project.local/some/custom/route
-> custom route worksproject.local/app_php/some/custom/route
-> custom route worksproject.local/app_dev.php/some/custom/route
-> 404 (contao_catch_all)Are you running nginx or Apache?
Apache. Just testet it: it works on nginx. That's interesting.
Then it must be a server misconfiguration. Did you alter the default web/.htaccess
?
Anyway, such issues should be resolved on the community forum, not here ;)
Nope that's the original one..
Then it must be a server misconfiguration
Since it does work on Nginx, I agree with @fritzmg.
Not sure where to put this as this might me rather a problem of the missing docs than a real issue.
If I understand correctly the idea of the
RoutingPluginInterface
is to be able to specify custom routes in your own bundles or theContaoManagerPlugin
in global namespace (analogous to what theBundlePluginInterface
is to loading bundles in the right order). When simply implementing the interface in both cases, thegetRouteCollection (...)
method never gets called (the class gets loaded, however). Is this the right approach or what am I missing?Btw.: In my case I am trying to setup legacy redirects from an old installation. For this case it would be handy if an
app/config/routing.yml
would be loaded if it exists like theconfig.yml
/config_*.yml
.