[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Adding 301 redir_permanent for some migrated items before 404 kicks in.



CAUTION: This e-mail originated outside the University of Southampton.

Wow, this wiki page exceeds any expectation, thanks! Very nice work.

I think the RewriteMap part is ok. If you want to support older systems (Eprints 3.2 for example), an urls.pl is already defined in lib/defaultcfg/cfg.d containing:

$c->{rewrite_exceptions} = [ '/cgi/', '/archive/' ];

so dropping z_rewrite_exceptions.pl will overwrite it. In Eprints 3.3 it works like 3.4 so this does not happen.

In our migration, I've created newid.txt with all the end URLs inside, even the ones that redirect to the new server, so only one file is needed and opened by Apache. You could use the RewriteMap approach also for internal redirects but it is very rare in Eprints.

The handler approach is the most flexible and the trigger one is the most sustainable over time (just a config). I agree that with a lot of entries, the rewrite_exceptions array search is not the most efficient so the trigger approach (using an hash) is the best one (efficiency, quite flexible and sustainable). In our migration we was using Eprints 3.2, the trigger was not available.


Il 16/02/23 22:16, John Salter via Eprints-tech ha scritto:
CAUTION: This e-mail originated outside the University of Southampton.
I've put together a Wiki page with Yuri and my suggestions (and a bonus one - if you love mod_perl 2) on it.

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FRedirect_specific_eprints_to_somewhere_else&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C97e0bdc56fa54fbd0df108db10bf8b0a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638122187073242879%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=haRCpS9kGvbcUzR22DGD%2FuMvTLWa6vesRhW%2F38dqUtM%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FRedirect_specific_eprints_to_somewhere_else&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C97e0bdc56fa54fbd0df108db10bf8b0a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638122187073399078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=0M%2FKh3AOh2LjvPP30FqOergCuhEZEOoBGTz0BYQCmtE%3D&reserved=0>

Yuri: can you check I've documented / understood your approach properly:
https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FRedirect_specific_eprints_to_somewhere_else%23Apache_RewriteMap_solution&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C97e0bdc56fa54fbd0df108db10bf8b0a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638122187073399078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uaO%2F9MB9NGsIcKe0g5pBeqoiDBUjaADfCluMF%2Bza5Bc%3D&reserved=0<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.eprints.org%2Fw%2FRedirect_specific_eprints_to_somewhere_else%23Apache_RewriteMap_solution&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C97e0bdc56fa54fbd0df108db10bf8b0a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638122187073399078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uaO%2F9MB9NGsIcKe0g5pBeqoiDBUjaADfCluMF%2Bza5Bc%3D&reserved=0>

Feel free to add / update / question the page as necessary!

Cheers,
John


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Matthew Brady via Eprints-tech
Sent: 16 February 2023 02:40
To: eprints-tech at ecs.soton.ac.uk<mailto:eprints-tech at ecs.soton.ac.uk>
Subject: Re: [EP-tech] Adding 301 redir_permanent for some migrated items before 404 kicks in.

CAUTION: This e-mail originated outside the University of Southampton.
Hi John and Yuri,

Thanks for the suggestions.
Its great to have an active mailing list.

Cheers

Matt.
__________________________________________________________________
This email (including any attached files) is confidential and is
for the intended recipient(s) only. If you received this email by
mistake, please, as a courtesy, tell the sender, then delete this
email.
The views and opinions are the originator's and do not necessarily
reflect those of the University of Southern Queensland. Although
all reasonable precautions were taken to ensure that this email
contained no viruses at the time it was sent we accept no
liability for any losses arising from its receipt.
The University of Southern Queensland is a registered provider
of education with the Australian Government.
(CRICOS Institution Code QLD 00244B / NSW 02225M, TEQSA PRV12081)



*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C97e0bdc56fa54fbd0df108db10bf8b0a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638122187073399078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DafHhSg0mgK5qNmOMa1CnWg4fJI3SAueJ7i9Z1elho0%3D&reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C97e0bdc56fa54fbd0df108db10bf8b0a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C638122187073399078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=8VTeCirVu9NvyBx53OS7sZJITwGw1NVMC2K%2FrvRv3GQ%3D&reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20230217/abac1335/attachment-0001.html