EPrints Technical Mailing List Archive
Message: #06337
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] technical question: one archive with two domains
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] technical question: one archive with two domains
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Thu, 9 Mar 2017 14:06:31 +0000
Hi Thorsten, If your page includes an html tag: <base href="" href="http://domain1.com/">http://domain1.com/" /> Then any href tags that are relative e.g. <a href="" would link to
http://domain1.com/my_page.html. If the base tag was changed to: <base href="" href="http://domain2.com/">http://domain2.com/" /> The same link would go to
http://domain2.com/my_page.html - which I think is what you're trying to do? In <eprints_root>/archives/<archiveid>/cfg/cfg.d/dynamic_template.pl you could then do something like (keeping the stuff that's there already!): $c->{dynamic_template}->{function} = sub { my( $repository, $parts ) = @_; # do stuff to work out what protocol was used,
my $r = $repository->request; # do stuff to work out what hostname was requested, which protocol was used etc. # not sure how to do this off the top of my head! # possibly things like $r->hostname ?
my $base = $repository->make_doc_fragment; $base->appendChild( $repository->make_element( "base", href="" "$protocol://$hostname" ) ); $parts->{base} = $base; … }; In your template, you would then add a pin (in the <head>): <epc:pin ref="base" /> https://wiki.eprints.org/w/API:EPrints/Apache/Template Alternatively you could append it to the 'head' pin (again, off the top of my head, can't think of how to do this). As I said, this might be a really bad idea (or might just not work!)… but if you're willing to experiment, it might help somehow! Cheers, John From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Thorsten Bülo Hey John, thanks for your answer. Bad ideas are usually the best ;) It would be great if you could explain your suggestion a little bit more, I don't really get what you mean. Thank you very much, best regards Thorsten Buelo University of Cologne Institut fuer Informatik
|
- References:
- Re: [EP-tech] technical question: one archive with two domains
- From: Thorsten Bülo <thorsten.buelo@gmail.com>
- Re: [EP-tech] technical question: one archive with two domains
- Prev by Date: Re: [EP-tech] technical question: one archive with two domains
- Next by Date: [EP-tech] DOI - Importing
- Previous by thread: Re: [EP-tech] technical question: one archive with two domains
- Next by thread: Re: [EP-tech] technical question: one archive with two domains
- Index(es):