File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 2323      var  language  =  languages [ code ] ; 
2424      if  ( ! language )  {  language  =  "en" ;  } 
2525
26-       document . location  =  "/"  +  language  +  "/" ; 
26+       // If we're running on localhost/loopback for local development, 
27+       // keep redirects relative so the developer can test locally. 
28+       var  host  =  window . location . hostname ; 
29+       var  isLocal  =  ( host  ===  'localhost'  ||  host  ===  '127.0.0.1'  ||  host  ===  '::1' ) ; 
30+       if  ( isLocal )  { 
31+         document . location  =  "/"  +  language  +  "/" ; 
32+       }  else  { 
33+         document . location  =  "https://www.ruby-lang.org/"  +  language  +  "/" ; 
34+       } 
2735    </ script > 
2836    < noscript > 
29-       < meta  http-equiv ="refresh " content ="0; url=/en/ "> 
37+       < meta  http-equiv ="refresh " content ="0; url=https://www.ruby-lang.org /en/ "> 
3038    </ noscript > 
3139  </ head > 
3240  < body > 
33-     < p > < a  href ="/en/ "> Click here</ a >  to be redirected.</ p > 
41+     < p > < a  href ="https://www.ruby-lang.org /en/> Click here</ a >  to be redirected.</ p > 
3442  </ body > 
3543</ html > 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments