Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basepath support in nextjs ? #2072

Closed
uidev547 opened this issue May 26, 2017 · 6 comments
Closed

basepath support in nextjs ? #2072

uidev547 opened this issue May 26, 2017 · 6 comments

Comments

@uidev547
Copy link

Do we have basepath support in next.js?
similar to basename in react router 4 (https://reacttraining.com/react-router/web/api/BrowserRouter/basename-string).

This is essential if we deploy the next.js application in particular path of the domain like
www.myexistingdomain.com/mynextjsapp (mynextjsapp is the path for next.js application)

Any suggestions or existing configurations for this scenario?

@janbaer
Copy link

janbaer commented May 29, 2017

See also this issue, it's unfortunately still not solved: #257

@arunoda
Copy link
Contributor

arunoda commented May 31, 2017

Closing this because of #257

@arunoda arunoda closed this as completed May 31, 2017
@brian-kilpatrick
Copy link

This doesn't seem like it was solved with the Zones feature that #257 concludes with. I need a single next.js app to live at ourdomain.com/admin, so that requests to /admin => / in the app. Am I missing a solution to this?

@knoebelja
Copy link

knoebelja commented Jun 6, 2018

I'm assuming you're using something like nginx to proxy pass.

Add assetPrefix: "/admin" to next.config.js and then when you make a NextLink do the following: <NextLink href={href} as={"/admin" + href}>{children}</NextLink>

If something needs more explanation google is your friend.

@dinofx
Copy link

dinofx commented Aug 7, 2018

Applications can have 100s of links in them. It's silly to have to set the "as" property over and over to the same href value plus some prefix.

@bgarrett-rt
Copy link

bgarrett-rt commented Dec 9, 2018

I believe this is the same issue I ran across. I posted a potential work around in the comments at: #257 (comment) Note: It did require running a custom express server.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 9, 2019
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

7 participants