Skip to content

Commit 531d897

Browse files
hsbtclaude
andcommitted
Use relative redirect for non-production environments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8e18754 commit 531d897

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

index.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@
2424
var language = languages[code];
2525
if (!language) { language = "en"; }
2626

27-
// If we're running on localhost/loopback for local development,
28-
// keep redirects relative so the developer can test locally.
2927
var host = window.location.hostname;
30-
var isLocal = (host === 'localhost' || host === '127.0.0.1' || host === '::1');
31-
if (isLocal) {
32-
document.location = "/" + language + "/";
33-
} else {
28+
if (host === 'www.ruby-lang.org') {
3429
document.location = "https://www.ruby-lang.org/" + language + "/";
30+
} else {
31+
document.location = "/" + language + "/";
3532
}
3633
</script>
3734
<noscript>

0 commit comments

Comments
 (0)