We are moving a website from Joomla to Mura and some of the pages are going to be located at different URLs.
I can set up 301 redirects in the rules section of the web.config
file in order to redirect the old URLs to new locations.
However, my boss wants me to create a custom 404 page that will determine the requested url and then redirect to the new one. Both pieces of information would be stored in a database that the custom 404 page will use to to make the correct redirection.
It's a question between doing
<rule name="rulename">
<match url="OLD_URL" />
<action type="Redirect" redirectType="Permanent" url="NEW_URL" />
</rule>
in the web.config file or,
<cfset path = cgi.path_info>
<cfif path eq "OLD_URL">
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="NEW_URL">
<cfabort>
In the header of the custom 404 page in the Coldfusion template. I did check and the Coldfusion redirect does return a 301 status code.
To me it seems like the 301 redirects in the web.config file are the better way to go, is there something I am missing here?