Skip to content

Commit

Permalink
Merge pull request #21 from azachwill/devcommit23
Browse files Browse the repository at this point in the history
url
  • Loading branch information
awilliams1275 authored Aug 19, 2024
2 parents 02bb58b + a15c580 commit 4ed2456
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netlify/edge-functions/hello.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ export default async (request, context) => {
if (url.pathname.startsWith('/py/docs') && url.pathname.endsWith('/')) {
// Remove the trailing slash and add .html extension
const newPathname = url.pathname.slice(0, -1) + '.html';
const newUrl = `${url.origin}${newPathname}${url.search}`;
const newUrl = `${url.origin}${newPathname}`;
}
else if ( url.pathname.endsWith('/index.html'))
else if ( url.pathname.endsWith('index.html'))
{
// Remove the trailing slash and add .html extension
const newPathname = url.pathname.slice(0, -1) + 'index.html';
const newUrl = `${url.origin}${newPathname}`;
}

else {
const newUrl = url.pathname ;
const newUrl = url ;
}
{
// Perform a 301 redirect
Expand Down

0 comments on commit 4ed2456

Please sign in to comment.