content icon indicating copy to clipboard operation
content copied to clipboard

IIS Config for Docs redirection

Open skoenfaelt opened this issue 4 years ago • 1 comments

Hello, we deploy our Nuxt Content Doc to an IIS Instance. Everything works fine.

If I open a docs page, all renders perfectly but as I hit F5, the IIS throws 404, since the route is js generated, the markdown files are not generated as HTML (even with yarn generate)

We implemented a web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Frontend Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

That worked for anglar but not for nuxt content docs. The Problem is, if we are on /de/some-doc and hit F5, we will redirect to the startpage, but the url stays the same. Also I cant click on the doc link, since the url says im on that page.

How do you manage the IIS redirection?

skoenfaelt avatar Aug 05 '21 08:08 skoenfaelt

@derHodrig

Providing a reproduction would help people dig into your issue.

nozomuikuta avatar Aug 06 '21 05:08 nozomuikuta

Closing this, since we decided to use SSR mode, which more or less solves the problem...

skoenfaelt avatar Feb 03 '23 13:02 skoenfaelt