1

I am facing problem in Microsoft's IIS deployment, By deploying "next export"'s static HTML generation code in the server.

The Code runs all okay, I can visit all the different pages by clicking the links in the HTML document. But if I manually copy the link and paste it in the browser's url bar it is showing me the following error

enter image description here

I have the live example hosted, Click Here

If we traverse to another page through the home page then it will not cause any problem. But if we manually insert "beta.amarstock.com/chart" in the browser's url bar then it is displaying the given error...

What to do now? Is it the normal behavior of next export command?

Thanks in Advance

  • You can refer to the tutorial to redeploy your application, and then revisit the page. https://stackoverflow.com/questions/61556758/how-to-deploy-react-next-js-on-iis – Theobald Du Jul 07 '21 at 01:53
  • @TheobaldDu Thanks! But I dont want to use any node server like iisnode. I want to deploy it like a static site – Wahid Hoque Jul 07 '21 at 05:40
  • Is it the same URL but in a different way there will be different effects in the URL bar? – Theobald Du Jul 08 '21 at 06:56

2 Answers2

0

For this problem, you need to check if there is any redirect/rewrite rule in your IIS or in your backend code. I test click "Chart" on home page, the url in browser will go to https://beta.amarstock.com/chart, but I found it request another url in fact as below screenshot show:

enter image description here

According to the screenshot above, we can find it request https://www.amarstock.com/Chart/draw... in fact. So if you input the url https://beta.amarstock.com/chart into browser directly, it will show 404 not found (please also pay attention to the case Chart and chart).

So I guess it may exists a logic which will redirect/rewrite to the url https://www.amarstock.com/Chart/draw... or in IIS url rewrite rule. Please check.

Hury Shen
  • 14,948
  • 1
  • 9
  • 18
0

You need to configure rewrite rules to access pages directly.

Please take a look at this article of mine about deploying a static html website built by next.js on IIS where you'll find how to accomplish this.

Zafer
  • 2,180
  • 16
  • 28