I'd like to add a default route to Silverstripe. At present, there are some routes in my application, being /dev, /admin and /api. I would like all other trafic that's not in a (virtual) subdirectory to be handled by a separate controller.
I've been playing around with the YAML config system, but I don't seem to be able to wrap my head around it.
So basicly I want to do the following
- /dev -> basic SS functionality, should be doing what it does :-)
- /admin -> cms module
- /api -> Restful api module,
But every other path should point to MyOwnController.
- /asdfsdfsd -> MyOwnController
- /23-asdf -> MyOwnController etc.
It's not necessary that /asda/asd also reroutes to MyOwnController.
I made a /mysite/_config/routes.yml file, containing the following:
---
Name: myroutes
After: 'framework/routes#coreroutes'
---
Director:
rules:
'$Path': 'MyOwnController'
This breaks the site (only 404's). How should this be set up? I could start fiddling in the _config.php, but I'd rather adhere to the standard :-)