[Koha-devel] How to make self-referential URLs in Koha

dcook at prosentient.com.au dcook at prosentient.com.au
Tue May 19 04:18:30 CEST 2020


Hi all,

 

With some recent code, I've been using creating self-referential URL in Koha
using CGI->url(), and passing it as a value. With CGI, the URL is correct
(ie starting with /cgi-bin/koha). With Plack, it's not, because the OPAC is
mounted as "/opac". 

 

I worked around this by rewriting the self-referential URL in my code, but I
was wondering if anyone else had any thoughts on this.

 

I've noticed there are a few places in Koha where we use CGI->url() and I'm
guessing we may have unexpected bugs in Plack-enabled Koha as a result. 

 

Of course, one workaround would be to have /opac and /intranet aliases or
URL rewriting in Apache, so that the self-referential URLs created by Plack
still end up resolving. I wonder if that's the easiest path forward.

 

In the past, I have wondered if we could get rid of "/cgi-bin/koha" as a
path prefix all together (especially as cgi-bin scares security tools), but
it's so deeply embedded in Koha at this point that it seems a huge task to
replace it. 

 

Anyway, just throwing that out there.

 

David Cook

Systems Librarian

Prosentient Systems

72/330 Wattle St

Ultimo, NSW 2007

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20200519/7b6be646/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 484 bytes
Desc: not available
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20200519/7b6be646/attachment.sig>


More information about the Koha-devel mailing list