Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Created July 3, 2014 15:38
Show Gist options
  • Save stevewithington/c101eb04ef7ef7cce76c to your computer and use it in GitHub Desktop.
Save stevewithington/c101eb04ef7ef7cce76c to your computer and use it in GitHub Desktop.
Mura CMS: By default, Mura will not throw a 404 on missing ".cfm" files. This is intended behaviour so that you can integrate existing applications with Mura. If you wish to override this behaviour, use the method in this Gist.
<cfscript>
// drop this into your SITE or THEME eventHandler.cfc to trigger a 404 on missing .cfm files
public any function onSiteRequestStart($) {
request.uri = GetPageContext().GetRequest().GetRequestURI();
request.template = Right(request.uri, 1) != '/' ? ListLast(request.uri, '/') : '';
if ( Len(request.template) && !FileExists(ExpandPath(request.template)) ) {
request.currentfilenameadjusted = request.template;
}
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment