Redirecting an archived asset


#1

Matrix Version:v5.3.4

We have a case where we archived an asset because that asset and all the children have been migrated to an external site (outside Matrix) and we would like to set up redirection from that asset to the new URL.

For example: https://example.com/awesomepage (for discussion sake, let’s say the asset ID is #4567) has been redeveloped and now lives in awesome.anotherexample.com which is outside Matrix.

What we have done is:

  1. archive #4567
  2. rename the web path to something else
  3. add to remap manager a redirection from https://example.com/awesomepage to awesome.anotherexample.com

And that works! Except for all hyperlinks that use ./?a=4567 which will end up 404 because #4567 has been archived.

Is it possible to make an archived asset redirect somewhere, hence retaining the web path?

Thanks.


(Tim Trodd) #2

In the remap manager can’t you remap the asset id itself? e.g. http://?a=4567 to your new url?


#3

So that’s actually a valid remap? I’ll try that.


#4

Hi @ttrodd I have tried that and it doesn’t work. I got this error message:

This URL is currently in use by Standard Page “Awesome page old” [#4567]. This remap is not currently being used.

Obviously even though we put in the asset ID, matrix still does the remap by its web path. And that web path has been used by the archived asset.


(Tim Trodd) #5

ah thats annoying thought that could potentially work.

I was going to say have you tried removing the web path from the asset before you archive it (so that asset has no path at all) and then setting the path on a new ‘redirect asset’ to your new site. Although not sure this would work either because of the short hand ./?a= stuff.

You may need to do this (rewrite_assetid_links.php):

https://matrix.squiz.net/manuals/server-administrator/chapters/system-management-scripts#rewrite_assetid_links.php


A question about remap / redirect to external servers
(Peter McLeod) #6

Hi
What happens when you make the asset live again?
Do the redirects work as expected?
Peter


(Bart Banda) #7

You could just make the asset live and apply a special paint layout/design to it that redirects to the new URL (either using JS or meta redirect tag) ?


(Douglas (@finnatic at @waikato)) #8

This is taking me back to the days when META REFRESH header tags were the way to do this… back when blink was momentarily (for a very short moment) “cool”.


(Douglas (@finnatic at @waikato)) #9

We look to handle this through rigorous link checks and content management practices, not on the server side.


#10

What @Bart suggested will work and in fact we have implemented some metadata where we can just put in the URL we want to redirect the asset to.

I guess that’s the way for now.

Although I am wondering if there is any reason why Matrix doesn’t “free up” web path once asset has been archived.

Thanks for all feedbacks.


(Bart Banda) #11

The main reason I’d say is that an Archived asset is still an asset in the system that could potentially be restored at a future date, therefore needing to maintain its asset ID and web path.

What could be nice though is to have a global search and replace tool for ./?a= type links perhaps (and maybe NOTICE links as well) that you could run separately to actually update any asset ID links pointing to the asset as a global update in the system?

Or alternatively, have a built in feature on the details screen of the asset that when it’s set to Archived, it lets the user pick another asset using an asset picker, to redirect any front-end requests to using a 301 redirect?


(Oliver Kass) #12

This comes up a lot for us. The asset picker idea on the details screen would be a tidy solution.


(Bart Banda) #13

Added new idea to Roadmap here: https://squizmap.squiz.net/matrix/11359