Created
July 3, 2014 15:38
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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