Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

rewrites dont work #28

Closed
AhmadAbuyahya opened this issue Sep 22, 2021 · 4 comments
Closed

rewrites dont work #28

AhmadAbuyahya opened this issue Sep 22, 2021 · 4 comments

Comments

@AhmadAbuyahya
Copy link

I want to add certain rewrites to one of my domains and it doesn't seem to work, this is what my next.config.js looks like:

module.exports = {
    async rewrites() {
        return [
            {
                source: '/someroute',
                destination: '/somepage',
            },
        ]
    },
}

I also tried adding the tenant name before and it also didn't work:

module.exports = {
    async rewrites() {
        return [
            {
                source: '/tenant/someroute',
                destination: '/tenant/somepage',
            },
        ]
    },
}

any help would be appreciated

@KjellConnelly
Copy link

This is how I use rewrites for catch-all route slugs... Maybe it'll give you some inspiration:

{
   source: '/blog/:slug*',
   destination: '/website1/blog/:slug*',
},

@micheleriva
Copy link
Owner

Hi @AhmadAbuyahya,
you can handle rewrites on the Express.js/Fastify level

@AhmadAbuyahya
Copy link
Author

Hi @AhmadAbuyahya, you can handle rewrites on the Express.js/Fastify level

is there no way to handle them from next?

@micheleriva
Copy link
Owner

@AhmadAbuyahya I think Express/Fastify could do that natively, so I'd suggest using them!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants