diff --git a/app/admin/view/error/401.html b/app/admin/view/error/401.html
index 07862acd5911ef291a0ded1a51459295e87f777d..508a941c10b35c3866b5bd0f631d70eeb6deaf13 100644
--- a/app/admin/view/error/401.html
+++ b/app/admin/view/error/401.html
@@ -53,7 +53,11 @@ document.getElementById("back").onclick=function(){
data = JSON.stringify(data);
sessionStorage.setItem('swiftadmin_template',data);
}
- top.window.location.replace(href.substring(0,href.indexOf('.php')+4));
+ if(href.indexOf('.php')=='-1'){
+ top.window.location.replace(href.match(/^[^:]+:\/\/[^/]+/)[0]+'/admin/');
+ }else{
+ top.window.location.replace(href.substring(0,href.indexOf('.php')+4));
+ }
}