Skip to content

Conversation

@jefft
Copy link
Contributor

@jefft jefft commented Oct 30, 2025

Jethro is full of href= and src= URL references, and is not too consistent in their use:

  • Some are page-relative, href="?call=..."
  • Some are incorrectly root-relative, href="/?view=...". These won't work if there is a URL path prefix e.g. /demo in https://easyjethro.com.au/demo
  • Some are correctly root-relative, href="<?php echo BASE_URL; ?>/?view=..."

This patch gets things more consistent by:

  • using page-relative URLs by default. Page-relative works fine, and doesn't have the code ugliness of <?php echo BASE_URL; ?> everywhere.
  • Use the BASE_URL prefix where necessary, i.e. before /resources, /public and /members URLs.
  • Remove the need for BASE_URL to end with a slash

By getting things consistent, it's actually possible to omit BASE_URL altogether, or set it to '' or '/demo'. This was my original goal: I want Jethro to run wherever it finds itself. If my Jethro normally runs at https://jethro.mychurch.com, by setting BASE_URL='' I can run it at http://localhost/mychurch without changing anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant