cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect to new website without change the URL

Highlighted
Occasional Visitor

Redirect to new website without change the URL

Hello 

 

I am having the following code :

 

$hostheader = http.getHostHeader();
$path = http.getPath();
$languages = [‘cs’, ‘cs-cs’, ‘pt’, ‘pt-pt’, ‘fi’, ‘fi-fi’, ‘sl’, ‘sl-sl’, ‘el’, ‘el-gr’, ‘sr’, ‘sr-sr’, ‘ro’, ‘ro-ro’, ‘hu’, ‘hu-hu’, ‘es’, ‘sv’, ‘de’, ‘de-de’, ‘cn’, ‘zh’, ‘zh-cn’, ‘ru’, ‘ru-ru’, ‘fr’, ‘fr-fr’, ‘pl’, ‘pl-pl’, ‘at’, ‘ja’, ‘ja-jp’, ‘zh-hk’, ‘de-at’];
if ($hostheader == “www.test.com” ) {
   foreach($lang in $languages) { 
   if (string.endsWithI($path, $lang) ) {
      http.setResponseHeader(“Host”, “myhost”);
      http.setHeader(“Host”, “myhost” . $lang);  
      if(!ssl.isSSL()) {  
        pool.use(“cms-splash-https-Pool”);
      }
      else {
       pool.use(“cms-splash-http-Pool”);
      }
   }
  }
}

I am trying to update the code so i can redirect all the user to new website but  without changing the old URL , is this possible and if yes how ?