This folder is intended for the purpose of redirecting URL calls to a different intended URL. This is done by utilizing variables in the calling URL and parsing them for the redirect.

http://stackoverflow.com/questions/11823784/redirection-to-a-specific-web-page-based-on-url-parameter-using-javascript


Code used:

function getQueryStringArray(){
    var assoc=[]; 
    var items = window.location.search.substring(1).split('&'); 
    for(var j = 0; j < items.length; j++) { 
       var a = items[j].split('='); assoc[a[0]] = a[1]; 
    }
    return assoc;
}

//point at which you want to determine redirection
var qs = getQueryStringArray();
var url = '';
if (qs.lang !== 'undefined' && qs.lang) {
   switch (qs.lang) {
      case 'en':
         url = 'blah';
         break;
      case 'de': 
         url = 'meh';
         break;
   }
   window.location.href = url; //reroute
 }