diff --git a/ghost/core/core/server/web/admin/middleware.js b/ghost/core/core/server/web/admin/middleware.js deleted file mode 100644 index c0f7214075..0000000000 --- a/ghost/core/core/server/web/admin/middleware.js +++ /dev/null @@ -1,17 +0,0 @@ -const urlUtils = require('../../../shared/url-utils'); - -function redirectAdminUrls(req, res, next) { - const subdir = urlUtils.getSubdir(); - const ghostPathRegex = new RegExp(`^${subdir}/ghost/(.+)`); - const ghostPathMatch = req.originalUrl.match(ghostPathRegex); - - if (ghostPathMatch) { - return res.redirect(urlUtils.urlJoin(urlUtils.urlFor('admin'), '#', ghostPathMatch[1])); - } - - next(); -} - -module.exports = [ - redirectAdminUrls -];