diff --git a/app/admin/view/error/404.html b/app/admin/view/error/404.html
index 72eeea7bbb18e4fcc6716c6f46ecee0a9acbe250..e88210de35a40bbf76f4fab5c77ecae1250a9179 100644
--- a/app/admin/view/error/404.html
+++ b/app/admin/view/error/404.html
@@ -54,7 +54,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));
+ }
}