My Day✳All blog articles ↗

Resolve a relative link from its explicit base URL

The same notes.txt produces different full addresses when the base ends with or without a slash.

A simple relative reference such as notes.txt needs an explicit base URL. If the base path ends in alpha without a trailing slash, keep the path through its last slash and replace alpha with notes.txt. If it ends in alpha/, append notes.txt after that slash. This computes an address; it does not check a website. File existence, readable access and safety remain unknown.

Case 1: base without a final slash. Case 2: base with a final slash; notes.txt stays unchanged.
Case 1: base without a final slash. Case 2: base with a final slash; notes.txt stays unchanged.

What to do

  1. Keep notes.txt and the complete base URL literally, including the presence or absence of its final slash.
  2. For notes.txt, retain the base path through the last slash and append notes.txt; do not automatically append it to the entire base.
  3. Record the original base beside the resulting full address. Check availability and content separately; do not guess an address without a known base.

Example

Fictional cases with no network requests: 1) notes.txt + https://example.org/projects/alpha → https://example.org/projects/notes.txt 2) notes.txt + https://example.org/projects/alpha/ → https://example.org/projects/alpha/notes.txt

My Day · Windows

In My Day, manually save the base, computed address and a separate checking task. This does not claim that My Day resolves URLs.

Buy My Day for Windows ↗