diff --git a/public/assets/games-page.js b/public/assets/games-page.js index f863fdf..1c8b4db 100644 --- a/public/assets/games-page.js +++ b/public/assets/games-page.js @@ -4,7 +4,7 @@ (function () { var esc = function (s) { return String(s == null ? '' : s).replace(/[&<>"']/g, function (c) { return ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]; }); }; var ref = ''; try { ref = new URLSearchParams(location.search).get('ref') || ''; } catch (e) {} - if (ref) { var j = document.getElementById('gJoin'); if (j) j.href = '/join?ref=' + encodeURIComponent(ref); } + if (ref) { var j = document.getElementById('gJoin'); if (j) j.href = '/join/' + encodeURIComponent(ref); } // the sponsored join page itself (bare /join used to 404, Diann 2026-10-11) function card(g) { var soon = !g.live && g.opens; var ribbon = g.season ? 'Limited time ยท ends ' + esc(g.season.ends) + '' : soon ? '' + esc(g.opens) + '' : ''; diff --git a/public/games.html b/public/games.html index 8d3d4da..e2a9abb 100644 --- a/public/games.html +++ b/public/games.html @@ -78,6 +78,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/server.js b/server.js index a0d0458..617417c 100644 --- a/server.js +++ b/server.js @@ -1744,6 +1744,14 @@ const server = http.createServer(async (req, res) => { // never changes an existing account's sponsor; the contract binds the buyer at // their first purchase). Codes resolve LATE (at buy time) to whatever chain id // the referrer has by then, so free members refer from day one. + // Bare /join (Diann 2026-10-11: the games page's "Join free" and the Friday/Wednesday pages linked to /join and got + // "Not found"): send the visitor to the sponsored join page. ?ref= has already been folded into the iap.sponsor cookie by + // the viral-link handler above, so the cookie decides; nobody known -> the company position, like the partner kit. + if ((p === '/join' || p === '/join/') && (req.method === 'GET' || req.method === 'HEAD')) { + const spon = String(parseCookies(req)['iap.sponsor'] || '').toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20); + u.searchParams.delete('ref'); const qs = u.searchParams.toString(); + res.writeHead(302, baseHeaders({ Location: '/join/' + (spon || 'company') + (qs ? '?' + qs : ''), 'Cache-Control': 'no-store' })); return res.end(); + } let m = /^\/join\/([A-Za-z0-9_]{1,20})$/.exec(p); if (m && (req.method === 'GET' || req.method === 'HEAD')) { // lead-capture page: email first, wallet later. ?v= picks the hook