Next.js App on IIS: 404 Error on Subpage Navigation Without .html Extension
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
Hi Guys, i made a post on stackoverflow asking about an issue i've been on for 3 days now.
Could anyone take a look please?
this is the link: https://stackoverflow.com/questions/78496237/next-js-app-on-iis-404-error-on-subpage-navigation-without-html-extension
The question:
# Issue with Next.js on IIS: Subpage Navigation Fails Without .html
The error i see on the browser: HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I have a Next.js app running on an IIS server. The app's base URL (e.g.,
Navigating the app without touching the browser url or refresh button works fine, it navigates me to the correct urls and even updates the url to the navigated page. so if i go from
important to know is that i use the app router nextjs provides so i need the app to be getting its routing trough the nextjs server which is running on NodeJs. The
Could anyone take a look please?
this is the link: https://stackoverflow.com/questions/78496237/next-js-app-on-iis-404-error-on-subpage-navigation-without-html-extension
The question:
# Issue with Next.js on IIS: Subpage Navigation Fails Without .html
The error i see on the browser: HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
I have a Next.js app running on an IIS server. The app's base URL (e.g.,
site.com) works fine, but navigating to subpages (e.g., site.com/subpage) fails unless I append .html (e.g., site.com/subpage.html). Additionally, navigation works within the app until I refresh the page or enter the URL manually.Navigating the app without touching the browser url or refresh button works fine, it navigates me to the correct urls and even updates the url to the navigated page. so if i go from
site.com to the about page, it updates the url to site.com/about. But the moment i press the refresh button or when i place my cursor inside of the url and press enter, i get the 404 error.important to know is that i use the app router nextjs provides so i need the app to be getting its routing trough the nextjs server which is running on NodeJs. The
no managed code is also toggled in the app pool on iis.6 Replies
Giant pandaOP
@Pritam_045 that's not fixing it 🥲
@Giant panda <@1033440164812443668> that's not fixing it 🥲
have you asked "AI" tools for this?
Giant pandaOP
I asked all of them haha. Even the new gpt4o
They all got the same answer. Change the web.config file, change the server.js file, install URL rewrite... i did all those things 😪
Sorry, I didn't understand the error properly, So I can't help you.