From 8b3ea85bd4deb77134c124e3b8fba4a483d9b24e Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Sat, 18 May 2013 23:03:57 +0100 Subject: [PATCH] closes #8 - admin redirects Adding a regex to match lots of different admin URLs and redirect them to /ghost/ --- app.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index bf87e283f5..1ca1c83d86 100644 --- a/app.js +++ b/app.js @@ -12,13 +12,11 @@ flash = require('connect-flash'), Ghost = require('./core/ghost'), I18n = require('./core/lang/i18n'), - helpers = require('./core/frontend/helpers'); - - - - var auth, + helpers = require('./core/frontend/helpers'), // ## Variables + auth, + /** * Create new Ghost object * @type {Ghost} @@ -68,7 +66,10 @@ ghost.app().get('/ghost/debug', auth, admin.debug.index); ghost.app().get('/ghost/debug/db/delete/', auth, admin.debug.dbdelete); ghost.app().get('/ghost/debug/db/populate/', auth, admin.debug.dbpopulate); - ghost.app().get('/ghost', auth, admin.index); + ghost.app().get(/^\/(ghost$|(ghost-admin|admin|wp-admin|dashboard|login)\/?)/, auth, function (req, res) { + res.redirect('/ghost/'); + }); + ghost.app().get('/ghost/', auth, admin.index); /** * Frontend routes..