diff --git a/next.config.js b/next.config.js index da2c7bf3e..78c6788e1 100644 --- a/next.config.js +++ b/next.config.js @@ -278,12 +278,12 @@ module.exports = withBundleAnalyzer( }, { source: '/:lang/audiobibles/books/ENGESV/:testamentCode/:bookCode/2', - destination: '/:lang/bibles', + destination: '/:lang/bibles/', permanent: false, }, { source: '/:lang/audiobibles/volumes', - destination: '/:lang/bibles', + destination: '/:lang/bibles/', permanent: true, }, { @@ -308,12 +308,12 @@ module.exports = withBundleAnalyzer( }, { source: '/:lang/audiobibles/books/ENGESV/2', - destination: '/:lang/bibles', + destination: '/:lang/bibles/', permanent: false, }, { source: '/:lang/audiobibles/books/ENGESV/2', - destination: '/:lang/bibles', + destination: '/:lang/bibles/', permanent: false, }, { @@ -345,11 +345,6 @@ module.exports = withBundleAnalyzer( permanent: false, destination: '/:lang/stories/albums/page/1', }, - { - source: '/:lang/bibles/:path*', - destination: '/:lang/biles/:path*', - permanent: true, - }, { source: '/:lang/audiobooks/books/:path*', destination: '/:lang/books/:path*', @@ -533,6 +528,10 @@ module.exports = withBundleAnalyzer( source: '/:lang/blog', destination: '/:lang/blog/page/1', }, + { + source: '/:lang/bibles', + destination: '/:lang/bibles/', + }, { source: '/:lang/books', destination: '/:lang/books/page/1', diff --git a/src/components/organisms/searchResults.filters.tsx b/src/components/organisms/searchResults.filters.tsx index e13706184..9404ca41a 100644 --- a/src/components/organisms/searchResults.filters.tsx +++ b/src/components/organisms/searchResults.filters.tsx @@ -26,9 +26,11 @@ export type EntityFilterId = keyof typeof filters; export function useContextualFilterId(): EntityFilterId { const { pathname } = useRouter(); const filterIds = Object.keys(filters) as EntityFilterId[]; - const filterId = filterIds.find((id) => - pathname.match(`/\\[language\\]\\/${id}/`) - ); + const filterId = filterIds.find((id) => { + if (pathname.match(`/\\[language\\]\\/${id}/`)) + return pathname.match(`/\\[language\\]\\/${id}/`); + else return pathname.match(`/\\[language\\]\\/${id}`); + }); return filterId || 'all'; }