added temporary redirection for old no-js urls

This commit is contained in:
coderaiser 2013-02-21 03:55:03 -05:00
parent d013d66d65
commit 32d9ac0845
2 changed files with 17 additions and 0 deletions

View file

@ -192,6 +192,9 @@
lRet = main.sendFile( pParams );
}
else if( Util.isContainStr(p.name, FS) || Util.strCmp( p.name, '/') ){
if( Util.isContainStr(p.name, 'no-js/') )
return noJSTMPRedirection(pParams);
var lQuery = main.getQuery(p.request),
lName = Minify.allowed.html ?
Minify.getName(INDEX) : INDEX;
@ -206,6 +209,7 @@
index : lName
});
}
/* termporary redirect for old urls */
else
lRet = false;
}
@ -213,6 +217,16 @@
return lRet;
}
function noJSTMPRedirection(pParams){
var MOVED_PERMANENTLY = 301,
lPath = Util.removeStr(pParams.name, 'no-js/');
pParams.response.writeHead(MOVED_PERMANENTLY, {'Location': lPath});
pParams.response.end();
return true;
}
/* function sets stdout to file log.txt */
function writeLogsToFile(){