Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Module routing


Go to End


2 Posts   1296 Views

Avatar
KatB

Community Member, 105 Posts

2 October 2015 at 8:54pm

I have a development site and a production site. On the development site is a module that works. I copied the folder of that module and dropped it into production site. I then flushed the site with /dev/build?flush=1. When loading a URI in the browser, I receive a 404 on the url where I expected to see something else. In the module is a controller extending from Page_Controller. From this page:https://docs.silverstripe.org/en/3.1/developer_guides/controllers/routing/ it looks like I don't need a routes.yaml file in my _config folder for the module as Silverstripe should automatically pick it up. I have looked high and low between the two to try to workout why one works but the other doesn't. Is there anything I should do to tell Silverstripe about this module or about the URI structures involved? Thanks, Kat

Avatar
KatB

Community Member, 105 Posts

7 October 2015 at 5:37pm

For anyone in the same boat as me, you'll need a routes.yaml in your mysite/_config/ folder. It looks like this:
---
Name: Routename
After: 'framework/routes#coreroutes'
---
Director:
rules:
'rootURI': 'ControllerName_Controller'