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

[EP-tech] redirect some eprintid url to another site

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

Hi John!

 thanks for sharing the gist. The objects are about 10.000, so I should load the map from a file. Unfortunately, It is an old Eprints without the EP_TRIGGER_URL_REWRITE but I think I just can copy the code at the begin of Rewrite.pm.


Il 14/03/22 16:35, John Salter ha scritto:
Hi Yuri,
I would use the EPrints URL Rewrite trigger.

How many items are mapped to the other system?
Do you want to map landing page requests to one URL, and document requests to another URL (e.g. directly to the document in the other system)?

This gist: https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fa5c574e1839612ef7e332d1d25edac42&data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C8bdf7a2fcca44889194b08da05d4c751%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828709122214628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=mb7%2FtOq7rByJWM8seZbI5Dlgc5seEirF0zCP%2F87SNJc%3D&reserved=0 allows you to specify the eprintid / new locations in a hash.
If all the new locations are on the same site, you could update line 19 to include the new base http URL, and just have the eprintid => otherid in the hash.

As written, it will capture requests for anything starting with the EPrintID (requests for the landing page; downloads; thumbnail requests).
You could map these URLs individually, and change the regex match on line 13 to redirect document requests to the new document URL; landing page requests to the new landing page etc.

Hope that helps - let me know if you need more info.


From: eprints-tech-bounces at ecs.soton.ac.uk<mailto:eprints-tech-bounces at ecs.soton.ac.uk> <eprints-tech-bounces at ecs.soton.ac.uk><mailto:eprints-tech-bounces at ecs.soton.ac.uk> on behalf of Yuri via Eprints-tech <eprints-tech at ecs.soton.ac.uk><mailto:eprints-tech at ecs.soton.ac.uk>
Sent: 14 March 2022 13:45
To: EPrints.org Technical List <eprints-tech at ecs.soton.ac.uk><mailto:eprints-tech at ecs.soton.ac.uk>
Subject: [EP-tech] redirect some eprintid url to another site

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


  we're migrating many objects from eprints to various other platform. I
would like to make redirects for the URLs of this documents. For example
from myeprint.com/eprintid to another.site.com/otherid (I have a map
with eprintid otherurl)

I'm trying to do it with RewriteMap and RewriteRule but Eprints define
the perl handler to manage urls (PerlTransHandler
EPrints::Apache::Rewrite) to handle rewrites. I would like not to use
cfg.d/url.pl because there are a lot of objects.

Any idea? Should I patch Rewrite.pm to do it internally from a mapfile?
Return DECLINED? I don't know if it is worth the time, I would prefer a
simpler solution.

*** Options: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C8bdf7a2fcca44889194b08da05d4c751%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828709122214628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=YsnSBVgbeTlc81xCA%2FXyTI2ApbYzZFaQYFOxX3CymUc%3D&amp;reserved=0
*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C8bdf7a2fcca44889194b08da05d4c751%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828709122214628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=BYg6kOsJVcqbHWW2alsq0yG%2FXJev%2FjxPqmgZdtPt5U4%3D&amp;reserved=0
*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C8bdf7a2fcca44889194b08da05d4c751%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828709122214628%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=EqLJBSYsmrl4gGecHr8bu%2B3cG%2FIukKiXO6oQvo3UuO4%3D&amp;reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20220314/4cffc25c/attachment.html