This is more a reminder for me, but could be useful for others as well. We use the Episerver 404 handler in most if not all of our projects. It does a good job of handling URL redirects and custom 404 pages.
Often we receive a spreadsheet of URLs from our customers with old URLs and where they should go to in the new site. These can easily be imported into the 404 handler module, but they need to be converted into a specific XML format first before importing.
This redirects within the same site.
This redirects to an old server.
Several out-dated urls can be redirected
to the same new url.
Old shortcut url to
new shortcut url!
<!-- Test to check that this should not
go into a infinite loop -->
<!-- You can also use site relative roots
for your destination, as the redirect
is done on the server.
<!-- Usually, when a "beginning of string" match is found, the path
and querystring of the old url is appended to the new one. This
can be used to redirect all pages below a given path to an old
server. If you do not want the string beeing appended, set the
onWildCardMatchSkipAppend to true.
For the Excel spreadsheet we can use string concatenation to create the XML in Excel.
Save it in an XML file and then import it through the 404 handler Gadget (you need to add the gadget called custom redirect manager to the dashboard):
Click the little configuration wheel in the bottom right corner and Administer.
Here you'll see different options, including exporting the redirects, what we're interested in is the import functionality.
Click Import redirects from an XML-file, choose the XML file with the redirects and click Import.
Note: If the import fails, take a look at the Episerver log file for more details. Usually there is some invalid XML characters involved. It's helpful to validate the XML before importing it. Another common error is duplicate keys (duplicate old URLs).
And that's it, thanks to the BV Network team for creating this awesome module.