diff --git a/ChangeLog b/ChangeLog index 125b4d1b..66b9db07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -160,6 +160,9 @@ for reading. * Commented e.stopImmediatePropagation() of function layerClick in contextmenu file, for correct work of context menu. +* Added temporary redirection for old no-js urls. + + 2012.12.12, Version 0.1.8 * Added ability to shutdown Cloud Commander diff --git a/cloudcmd.js b/cloudcmd.js index adc14c4c..6d2b73a7 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -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(){