Very new to Coldfusion, but not to web development so hopefully this is an easy question.
We recently changed a link on our website that took us to /folder/index.cfm
. I want to make sure that when someone types www.ourwebsite.com/folder
that it doesn't take them to /folder/index.cfm
and instead to redirect them to another website.
Any pointers?
There are at least three ways it to do this.
This might help you with some of that: Custom 404 error page not working on IIS 8.5
You can make a file at /folder/index.cfm
and have a file that has
OR with cfscript
<cfscript>
location("newpage.cfm", false, 301)
</cfscript>
Note the addtoken and statuscode are optional. Add token helps because almost no CF website uses this kind of token. The status code helps because tells the browser that this is a permanent move.
application.cfc
. In fact, in some systems all requested are checked for validity in application.cfc
. You might still need a blank page at the target, but at least some ColdFusion is processedOf all the options, 1 is my favorite, because there really isn't a lot that can be done with requests to missing pages. And the list of potential missing pages is unlimited.