Utility Function: PermanentRedirect()
- November 28, 2008 5:30 AM
- Utility Function
- Comments (0)
I really can't take any credit for this one. The idea and the core code come from Pete Freitag's blog post "What CFLOCATION Does". Its probably not even original to wrap it in a function, but here it is any way.
<cffunction name="PermanentRedirect" output="false" returntype="void">
<cfargument name="url" type="string" required="false" />
<cfheader statuscode="301" statustext="Moved Permanently" />
<cfheader name="Location" value="#arguments.url#" />
<cfabort />
<cfreturn />
</cffunction>