diff --git a/url-rewrite-single-page-apps/index.js b/url-rewrite-single-page-apps/index.js index 7033d21..f50ea86 100644 --- a/url-rewrite-single-page-apps/index.js +++ b/url-rewrite-single-page-apps/index.js @@ -8,8 +8,15 @@ function handler(event) { } // Check whether the URI is missing a file extension. else if (!uri.includes('.')) { - request.uri += '/index.html'; + var response = { + statusCode: 302, + statusDescription: 'Moved Permanently', + headers: { + 'location': { value: uri + '/' } + } + }; + return response; } return request; -} \ No newline at end of file +}