Skip to content

Commit

Permalink
Merge pull request #28 from azachwill/devcommit31
Browse files Browse the repository at this point in the history
devcommit31
  • Loading branch information
awilliams1275 authored Aug 20, 2024
2 parents 18060e8 + 88c0836 commit 11c966e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netlify/edge-functions/redirect_article.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default async (request, context) => {
const url = new URL(request.url);
// Check if the URL path starts with /docs and ends with a trailing slash
if (url.pathname.startsWith('/py/docs') && url.pathname.endsWith('/')) {
if ( (url.pathname.startsWith('/py/docs') || url.pathname.startsWith('/py/api') ) && url.pathname.endsWith('/') ) {
// Remove the trailing slash and add .html extension
const newPathname = url.pathname.slice(0, -1) + '.html';
const newUrl = `${url.origin}${newPathname}`;
Expand Down

0 comments on commit 11c966e

Please sign in to comment.