diff --git a/conference.js b/conference.js index f9e579dcbfd6..284d28840806 100644 --- a/conference.js +++ b/conference.js @@ -211,7 +211,14 @@ function maybeRedirectToWelcomePage(options) { if (config.enableWelcomePage) { setTimeout(() => { APP.settings.setWelcomePageEnabled(true); - window.location.pathname = "/"; + if ( window.location.pathname.lastIndexOf("/") > -1 ) { + window.location.pathname = + window.location.pathname.substring( + 0, window.location.pathname.lastIndexOf("/") + 1); + } + else { + window.location.pathname = "/"; + } }, 3000); } } diff --git a/index.html b/index.html index de9e5aad5747..7d5c6c4cd2e8 100644 --- a/index.html +++ b/index.html @@ -120,12 +120,12 @@ window.addEventListener( 'error', loadErrHandler, true /* capture phase type of listener */); - + - - + + diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 10a502cc2acc..99230bf70166 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -397,7 +397,8 @@ UI.getSharedVideoManager = function () { UI.start = function () { document.title = interfaceConfig.APP_NAME; var setupWelcomePage = null; - if(config.enableWelcomePage && window.location.pathname == "/" && + var regex = /\/([a-zA-Z0-9=\?]+)$/g; + if(config.enableWelcomePage && !regex.exec(window.location.pathname) && Settings.isWelcomePageEnabled()) { $("#videoconference_page").hide(); if (!setupWelcomePage) diff --git a/modules/UI/welcome_page/WelcomePage.js b/modules/UI/welcome_page/WelcomePage.js index 6777ff23a5bb..55ec27ac7057 100644 --- a/modules/UI/welcome_page/WelcomePage.js +++ b/modules/UI/welcome_page/WelcomePage.js @@ -8,7 +8,10 @@ function enterRoom() { val = $enterRoomField.data("room-name"); } if (val) { - window.location.pathname = "/" + val; + if (val.slice(-1) !== "/") { + window.location.pathname += "/"; + } + window.location.pathname += val; } } diff --git a/title.html b/title.html index 5a01153d53f6..43ca2467074e 100644 --- a/title.html +++ b/title.html @@ -1,9 +1,9 @@ Jitsi Meet - + - - \ No newline at end of file + + \ No newline at end of file diff --git a/utils.js b/utils.js index 00192dbefaa8..7d70e7d5fa97 100644 --- a/utils.js +++ b/utils.js @@ -20,15 +20,17 @@ function getRoomName () { // eslint-disable-line no-unused-vars roomName = config.getroomnode(path); } else { /* fall back to default strategy - * this is making assumptions about how the URL->room mapping happens. - * It currently assumes deployment at root, with a rewrite like the - * following one (for nginx): - location ~ ^/([a-zA-Z0-9]+)$ { - rewrite ^/(.*)$ / break; - } - */ + * This is making assumptions about how the URL->room mapping happens. + * It assumes that the room name is expressed in the URL in the last + * part of the (non-empty) URL path, that matches the regular + * expression pattern used for rewrite rules in NGINX: [a-zA-Z0-9=\?]+ + */ if (path.length > 1) { - roomName = path.substr(1).toLowerCase(); + var regex = /\/([a-zA-Z0-9=\?]+)$/g; + var match = regex.exec(path); + if ( match && match.length > 0 ) { + roomName = match[1].toLowerCase(); + } } }