fix: comprehensive asset rewrites to resolve 404s in klz showcase
All checks were successful
All checks were successful
This commit is contained in:
@@ -40,6 +40,7 @@ const nextConfig = {
|
|||||||
async rewrites() {
|
async rewrites() {
|
||||||
return {
|
return {
|
||||||
beforeFiles: [
|
beforeFiles: [
|
||||||
|
// Assets requested from root
|
||||||
{
|
{
|
||||||
source: '/assets/:path*',
|
source: '/assets/:path*',
|
||||||
destination: '/showcase/klz-cables.com/assets/:path*',
|
destination: '/showcase/klz-cables.com/assets/:path*',
|
||||||
@@ -52,6 +53,19 @@ const nextConfig = {
|
|||||||
source: '/wp-includes/:path*',
|
source: '/wp-includes/:path*',
|
||||||
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-includes/:path*',
|
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-includes/:path*',
|
||||||
},
|
},
|
||||||
|
// Assets requested relatively from case-studies/work/blog subpages
|
||||||
|
{
|
||||||
|
source: '/:folder(case-studies|work|blog)/assets/:path*',
|
||||||
|
destination: '/showcase/klz-cables.com/assets/:path*',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: '/:folder(case-studies|work|blog)/wp-content/:path*',
|
||||||
|
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-content/:path*',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: '/:folder(case-studies|work|blog)/wp-includes/:path*',
|
||||||
|
destination: '/showcase/klz-cables.com/assets/klz-cables.com/wp-includes/:path*',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user