Next.js Discord

Discord Forum

Static Site with Github Pages basepath issue

Answered
Cinnamon posted this in #help-forum
Open in Discord
CinnamonOP
Hi, I'm about finished with a site that we're going to end up hosting on GH Pages, and we're running into an issue here at the end. I currently have the site demo hosted at https://nealium104.github.io/lextalk-tech/. Whenever the user navigates to another page and then back the homepage, the URL directs to https://nealium104.github.io/lextalk- which obviously throws a 404. I've tried setting the basepath to a few different things, but I still can't figure out what it needs to be set to.

Here's my GitHub Repo for reference. https://github.com/Nealium104/lextalk-tech
Answered by riský
i see your issue, does enabling trailing slashes fix it?
View full answer

11 Replies

i see your issue, does enabling trailing slashes fix it?
Answer
from my understanding, it is trying to access this wrong, and then error page does weird things to url...
also, is this your actual db url: https://github.com/Nealium104/lextalk-tech/blob/main/.env (prob shouldn't be in github if so..)
CinnamonOP
That makes a lot of sense. I just pushed the change to the next config. 🤞
i think your github actions error was because you added slash to base path, only add training slash option, and keep base normal/like before
CinnamonOP
Success!
Thank you so much!
YAY 🎉
yeah, i kinda wasn't sure if it would fix it, but glad to hear that 🙂
CinnamonOP
Yeah, I've been busting my head trying to figure it out. This isn't even where we're hosting on the final version anyway, but I think I understand it enough to make the final changes at the end.