Docz: Routing problem

Created on 15 Jun 2018  路  6Comments  路  Source: doczjs/docz

Bug Report

Describe the bug

Routes are active only for the current session. If someone shares the link to one of the pages in the documentation (or even reload the page), they will come across a 404 page.

To Reproduce

  1. Go to your documentation.
  2. Click on a new section.
  3. You'll get a root like domain.com/section
  4. Access this url on a new tab

Expected behavior

Access the shared page

2018-06-15_11 56 11

Most helpful comment

@adrianoresende Deploying with Netlify, add this file at the root of your project. It should fix your issue:

# COMMENT: This a rule for Single Page Applications
[[redirects]]
  from = "/*"
  to = "/"
  status = 200

References:

All 6 comments

Github Pages do not support SPA.
You can take a look here https://github.com/rafrex/spa-github-pages/blob/gh-pages/README.md

I have the same error, but I deployed on Netlify.
This error happens with Surge.sh too

My configuration:

export default {
  title: 'Docz',
  description: 'This is my awesome documentation',
  menu: [
    'Bem vindo',
    'Princ铆pios de design',
    {
      name: 'Estilos',
      menu: [
        'Cores',
        'Tipografias',
      ],
    },
    {
      name: 'Componentes',
      menu: [
        'Bot茫o',
      ],
    },
    'Marketing',
    'Produto',
    'Recursos',
    'FAQ',
  ],
  src: './src',
  public: './src/public',
  plugins: [],
  theme: 'docz-theme-default',
  themeConfig: {
    logo: {
      src: '/public/imgs/logo.svg',
      width: '100%',
    },
    colors: {
      primary: '#4967a9',
    },
  },
  htmlContext: {
    favicon: '/public/favicon.png',
  },
}

What's the solution?

@renatorib @pedronauck

@adrianoresende Deploying with Netlify, add this file at the root of your project. It should fix your issue:

# COMMENT: This a rule for Single Page Applications
[[redirects]]
  from = "/*"
  to = "/"
  status = 200

References:

@tpucci Thanks! ;)

Hey guys, if you want to support gh-pages still, there is a tiny workaround you can do:

https://github.com/sumup/circuit-ui/pull/437/files#diff-eae600270579316beb8b8d9b9a5732d4R4

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YardWill picture YardWill  路  3Comments

koddr picture koddr  路  3Comments

mariusespejo picture mariusespejo  路  3Comments

danburzo picture danburzo  路  3Comments

mquandalle picture mquandalle  路  3Comments