Skip to content

Conversation

@jefft
Copy link
Contributor

@jefft jefft commented Sep 17, 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.

@jefft jefft force-pushed the push-relative-urls branch from 954d6fc to b4ab1cf Compare September 18, 2025 13:10
@jefft jefft force-pushed the push-relative-urls branch from b4ab1cf to ec107e8 Compare September 26, 2025 05:57
@jefft jefft force-pushed the push-relative-urls branch 2 times, most recently from b94b9d5 to 1778611 Compare October 14, 2025 06:09
@tbar0970
Copy link
Owner

Related: #93

@jefft jefft force-pushed the push-relative-urls branch from 1778611 to e15be86 Compare October 17, 2025 02:59
@jefft jefft closed this by deleting the head repository Oct 27, 2025
@jefft
Copy link
Contributor Author

jefft commented Oct 30, 2025

Replaced by #1351

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.

2 participants