<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><font size="4">Hi both,</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">I have been doing something similar recently,
        albeit for abstract pages.&nbsp; I prefer the brute force approach of
        adding to $c-&gt;{rewrite_exceptions} and them manually adding
        the Apache Mod Rewrite rules to an archive level file called
        cfg/apache_redirects.conf and then including that in&nbsp;
        cfg/apachevhost.conf and/or ssl/securevhost.conf.&nbsp; You could
        write a script to programmatically generate this and the cfg.d
        file for rewrite_exceptions from a mapping file.</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">I had considered doing something that would allow
        you to add a metadata field called redirect_url or similar that
        you could just edit as a user (probably an admin or editor only
        if the item is live), which could then be used to automatically
        redirect off site.&nbsp; However, that would require some changes at
        a core level, which feels a bit excessive for tackling this
        problem. <br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4"> One option, if you want to redirect just from
        abstract pages, is you could test for this new redirect_url
        field being set and if it is embedding some JavaScript in the
        abstract page that redirects to the new URL.&nbsp; That is a bit
        hacky but makes it easier to add new items to be redirected in
        future rather than having to maintain a mappings list
        independent of the database.&nbsp; However, this is no use if you
        want to redirect document URLs.&nbsp; I am not sure whether that is
        what you want to do?</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">Regards</font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">David Newman<br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <div class="moz-cite-prefix">On 14/03/2022 4:07 pm, Yuri via
      Eprints-tech wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:6f2ecd09-c345-4a1c-cdd2-22b043d61251@alfa.it">
      
      <div style="padding-bottom: 10px; padding-top: 5px;">
        <div style="padding:12px; border:1px solid #8D3970;
          background-color:#F7F9FA; color:#8D3970; font-size:14px;
          line-height:22px; font-family: Calibri, Arial, Helvetica,
          sans-serif;">
          <strong>CAUTION:</strong> This e-mail originated outside the
          University of Southampton.
        </div>
      </div>
      <div>
        <p>Hi John!</p>
        <p><br>
        </p>
        <p>&nbsp;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.</p>
        <p><br>
        </p>
        <p>Thanks!<br>
        </p>
        <p><br>
        </p>
        <div class="moz-cite-prefix">Il 14/03/22 16:35, John Salter ha
          scritto:<br>
        </div>
        <blockquote type="cite" cite="mid:DU2PR03MB7895D7192AF8DEF34B574272C40F9@DU2PR03MB7895.eurprd03.prod.outlook.com">
          <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            Hi Yuri,</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            I would use the EPrints URL Rewrite trigger.</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            How many items are mapped to the other system?</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            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)?</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            This gist:&nbsp;<a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fa5c574e1839612ef7e332d1d25edac42&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C676cabbd597c4766b0fa08da05dc30e3%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828740507978966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=1ud6HaspzgbGRwPWRPo2cFlZnguDSTq4Z543Ef35NTE%3D&amp;reserved=0" originalSrc="https://gist.github.com/jesusbagpuss/a5c574e1839612ef7e332d1d25edac42" shash="s2nBeEJV0lvCngrfic3e21NpHLdHw0JzCGH28IHU5sQaPj6sBftOjddpMMoNMS8eZxraRXQZIc1DOUykmnWoMvmrRfCQ6PkWGi8FPdbbPDMKQUQi1AIUTNaw3E/ZkcNDH40W2c9CnPxvZJZ0u1hDiLmqv6sDDMd44GQm/9d1/2E=" originalsrc="https://gist.github.com/jesusbagpuss/a5c574e1839612ef7e332d1d25edac42" shash="b44dHFpbhN1GdSocKLaWLq1p7nDWPawJepIOeoCL2yzPsUgf4MkIMtlj7ODevh2KofK4I/UUIxrYX9z163zX+f5d8bPI82RZbho9XVpc96seUp3jZ79SdvOE8E8t8Zydfz2qh3O76H8X3GS7R+VspSroInbIom+3l9n8kXutDTY=" id="LPNoLPOWALinkPreview" moz-do-not-send="true" class="moz-txt-link-freetext">https://gist.github.com/jesusbagpuss/a5c574e1839612ef7e332d1d25edac42</a>&nbsp;allows
            you to specify the eprintid / new locations in a hash.</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            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 =&gt; otherid in the hash.</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            As written, it will capture requests for anything starting
            with the EPrintID (requests for the landing page; downloads;
            thumbnail requests).</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            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.</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            Hope that helps - let me know if you need more info.</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            Cheers,</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            John</div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <div style="font-family: Calibri, Arial, Helvetica,
            sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
            <br>
          </div>
          <hr style="display:inline-block;width:98%" tabindex="-1">
          <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
              <a class="moz-txt-link-abbreviated moz-txt-link-freetext" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" moz-do-not-send="true">
                eprints-tech-bounces@ecs.soton.ac.uk</a> <a class="moz-txt-link-rfc2396E" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" moz-do-not-send="true">
                &lt;eprints-tech-bounces@ecs.soton.ac.uk&gt;</a> on
              behalf of Yuri via Eprints-tech <a class="moz-txt-link-rfc2396E" href="mailto:eprints-tech@ecs.soton.ac.uk" moz-do-not-send="true">
                &lt;eprints-tech@ecs.soton.ac.uk&gt;</a><br>
              <b>Sent:</b> 14 March 2022 13:45<br>
              <b>To:</b> EPrints.org Technical List <a class="moz-txt-link-rfc2396E" href="mailto:eprints-tech@ecs.soton.ac.uk" moz-do-not-send="true">
                &lt;eprints-tech@ecs.soton.ac.uk&gt;</a><br>
              <b>Subject:</b> [EP-tech] redirect some eprintid url to
              another site</font>
            <div>&nbsp;</div>
          </div>
          <div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
                <div class="PlainText">CAUTION: This e-mail originated
                  outside the University of Southampton.<br>
                  <br>
                  Hi!<br>
                  <br>
                  &nbsp; we're migrating many objects from eprints to various
                  other platform. I<br>
                  would like to make redirects for the URLs of this
                  documents. For example<br>
                  from myeprint.com/eprintid to another.site.com/otherid
                  (I have a map<br>
                  with eprintid otherurl)<br>
                  <br>
                  I'm trying to do it with RewriteMap and RewriteRule
                  but Eprints define<br>
                  the perl handler to manage urls (PerlTransHandler<br>
                  EPrints::Apache::Rewrite) to handle rewrites. I would
                  like not to use<br>
                  cfg.d/url.pl because there are a lot of objects.<br>
                  <br>
                  Any idea? Should I patch Rewrite.pm to do it
                  internally from a mapfile?<br>
                  Return DECLINED? I don't know if it is worth the time,
                  I would prefer a<br>
                  simpler solution.<br>
                  <br>
                  <br>
                  *** Options: <a href="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%7C676cabbd597c4766b0fa08da05dc30e3%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828740507978966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=mVbEup03xY1LEyv2U4OhMl9DG8vNxCFNzBEG7gVanhc%3D&amp;reserved=0" originalSrc="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" shash="v/0QL8dUYHMmpVFJ1zsELDJxlxynUgrYSVY257r4BtT9OlYEK0evly6jJgF1scqFATe9diGymQTRUBqIZrFfMW9Kf5DkeKNf8sRZntKODYmjnDOvVckF+10Q6LW3wfrSJ3UJFqerIx/pJCDDYyc7LmO1INvfc56ufp1J0fnvHuQ=" originalsrc="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" shash="C21EGj1RPGAzVDIBDhgXWRNcS1QyfEcwz7ed2NrBISAhVVPVOidmXHci3qi6cw+bHxnhuCW/t90KaQLSQJ4Gs0/WDOArto6BKeyyoFVpt4syMOmX8bppmZTKi/ID9tZJaZrbrCBPU+IITK2GKdtRlpftG8jIfQxILoq9TBSTjDc=" moz-do-not-send="true">
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&amp;amp;data=04%7C01%7CJ.Salter%40leeds.ac.uk%7C8bb7948ea1094eb8d25b08da05c18c2d%7Cbdeaeda8c81d45ce863e5232a535b7cb%7C1%7C0%7C637828626342660990%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;amp;sdata=CWsbLXKKlI%2FlywSS10%2F5e79FaeDpl8hbEyUcguQ%2FJDc%3D&amp;amp;reserved=0</a><br>
                  *** Archive: <a href="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%7C676cabbd597c4766b0fa08da05dc30e3%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828740507978966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=OVMHYI7V1rbqUTJs7PPUHs6MKnAjKyZ5Foe90SAoKEY%3D&amp;reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="sGTVVCNtCY9SV86PoD/h/orEUMy4LVd/z1aQxx0g59/ekGjuJAAZpxqYFczNXX+huPIAdOTAha2WO7mCAaio+SHrYhR0s2Zcp1Ni3iMhfTDqDE4Qi0UUEDzUYjWW/BB3QmNOZ2mzY8qEGiQ5bvjwsivOhCBzlaUewOphz+iYnn4=" originalsrc="http://www.eprints.org/tech.php/" shash="AoJqBQV/2ksVuQHhNMnolGrYj+4z9fVFOpet6LzR2NSgDIKc87nW/m+0hphGCSACDZ1VZagNGTdRdiJkX8HIZEz/Y9Wb70EYe90WNFOotv/XYjtuvltZaacjog+FG/tIgxrzWrtdhrnLsK/qmqCqPGjsIWiC2/arxsCpaheXOdQ=" moz-do-not-send="true">
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;amp;data=04%7C01%7CJ.Salter%40leeds.ac.uk%7C8bb7948ea1094eb8d25b08da05c18c2d%7Cbdeaeda8c81d45ce863e5232a535b7cb%7C1%7C0%7C637828626342660990%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;amp;sdata=0XS6HmJAybExIQbUk8p%2FB1asLntaSGKGwoZ%2Fj96MfgQ%3D&amp;amp;reserved=0</a><br>
                  *** EPrints community wiki: <a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C676cabbd597c4766b0fa08da05dc30e3%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828740507978966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=qbPXg9uOqJwo0de0aFvQv5FqF7vMWaPWmj8J9KKoVdM%3D&amp;reserved=0" originalSrc="http://wiki.eprints.org/" shash="qTG+cuUCzRT3ebe2rMc1Nj65IhomT8Ct5kiMKZ38EuYUeHpmSINX7dTn7LS0vFAyhwslA7osF8Wjv52vP9FHA8bWT9qCSO1YgYNxiHqGJfVqrJgKFvHtM4js2JMBOkrjLMn6FsC9BNgk+DzvHv7myR4exgClF+pWHnypdT4cO1Y=" originalsrc="http://wiki.eprints.org/" shash="fKgi1lnieFYzxupLSeAaC5QNYQplJoWy2G/72vQpj5kiplyjtbkx/TfcHJ8T80zT8jCaJaYk5K/xAN2t/z4kt7nrSty4MN42JgltRqkR6XfvwasdPJMndoEXxLkulet4soinixUx5S20XbY7AMHeeUflPyj5zTHSybMwNF/TYC4=" moz-do-not-send="true">
https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;amp;data=04%7C01%7CJ.Salter%40leeds.ac.uk%7C8bb7948ea1094eb8d25b08da05c18c2d%7Cbdeaeda8c81d45ce863e5232a535b7cb%7C1%7C0%7C637828626342660990%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;amp;sdata=iViKROkkJ3nKNy0MbLq2S%2BA8O4pQUOck9JnBKCBDyes%3D&amp;amp;reserved=0</a><br>
                </div>
              </span></font></div>
        </blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="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%7C676cabbd597c4766b0fa08da05dc30e3%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828740507978966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=OVMHYI7V1rbqUTJs7PPUHs6MKnAjKyZ5Foe90SAoKEY%3D&amp;reserved=0" originalSrc="http://www.eprints.org/tech.php/" shash="sGTVVCNtCY9SV86PoD/h/orEUMy4LVd/z1aQxx0g59/ekGjuJAAZpxqYFczNXX+huPIAdOTAha2WO7mCAaio+SHrYhR0s2Zcp1Ni3iMhfTDqDE4Qi0UUEDzUYjWW/BB3QmNOZ2mzY8qEGiQ5bvjwsivOhCBzlaUewOphz+iYnn4=">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=04%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C676cabbd597c4766b0fa08da05dc30e3%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637828740507978966%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=qbPXg9uOqJwo0de0aFvQv5FqF7vMWaPWmj8J9KKoVdM%3D&amp;reserved=0" originalSrc="http://wiki.eprints.org/" shash="qTG+cuUCzRT3ebe2rMc1Nj65IhomT8Ct5kiMKZ38EuYUeHpmSINX7dTn7LS0vFAyhwslA7osF8Wjv52vP9FHA8bWT9qCSO1YgYNxiHqGJfVqrJgKFvHtM4js2JMBOkrjLMn6FsC9BNgk+DzvHv7myR4exgClF+pWHnypdT4cO1Y=">http://wiki.eprints.org/</a></pre>
    </blockquote>
  </body>
</html>