Rewrites not working (next config)
Answered
Arinji posted this in #help-forum
ArinjiOP
Ok so i have this code in my next config
However the rewrites dont need to be working,
Source: https://startminecraft.com/
Destination: https://startminecraft.com/software/vanilla
I want the source page to match the data of the destination page :D
async rewrites() {
return [
{
source: "/",
destination: "/software/vanilla",
},
];
},However the rewrites dont need to be working,
Source: https://startminecraft.com/
Destination: https://startminecraft.com/software/vanilla
I want the source page to match the data of the destination page :D
Answered by riský
you may be having a homepage already, so what i did was made use of the
beforeFiles option for that14 Replies
@Arinji Ok so i have this code in my next config
tsx
async rewrites() {
return [
{
source: "/",
destination: "/software/vanilla",
},
];
},
However the rewrites dont need to be working,
Source: https://startminecraft.com/
Destination: https://startminecraft.com/software/vanilla
I want the source page to match the data of the destination page :D
you may be having a homepage already, so what i did was made use of the
beforeFiles option for thatAnswer
Woah never knew this beforeFiles and stuff existed
it took me like a hour to work out why i couldnt scam rewrite away my homepage if logged in 😭
i have since rewrited my root (/) to /home instead, but still use beforeFiles as it makes more sense to me
@riský you may be having a homepage already, so what i did was made use of the `beforeFiles` option for that
ArinjiOP
Why do you think I made the forum hehe, I knew you had messed around with rewrites before :) this shit hella magical xD
half of my chaos will never been documented anywhere, so this is good ig so others can search on google :)
ArinjiOP
Def
Imma test it out, one sec
but once you read the docs very carefully, your like this makes sense... why didnt i realise
ArinjiOP
@riský just to check,
something like this right?
async rewrites() {
return {
beforeFiles: [
{
source: "/",
destination: "/software/vanilla",
},
],
};
},something like this right?
should be
ArinjiOP
Works perfectly, thanks for the help :D
Enjoy the point xD, you could use some