Skip to content

Default shortened URLs (ozh, yourls, yourlsblog) work, but any new shortened URLs only direct back to the root subdomain #3487

Answered by dgw
EscoNomad asked this question in Q&A
Discussion options

You must be logged in to vote

I had a theory that caching was involved, but since you provided test links and the exact same behavior happened to me… Nope, that theory was immediately proved wrong. But testing led me to what is happening.

The default links have a scheme: For example, ozh points to https://ozh.org/.

Your test fb keyword points to facebook.com. It has no scheme. When YOURLS sends this in a Location header, this value is treated as a relative URL—the browser tries to load https://x.organicscience.jp/facebook.com, and is then redirected to / (the root) by YOURLS' default keyword-not-found behavior.

Here is a verbose cURL log, with the irrelevant bits (TLS negotiation, raw IPs, etc.) stripped out, showing …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EscoNomad
Comment options

Answer selected by EscoNomad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants