server.htmlFallback

  • Type: false | 'index'
  • Default: 'index'

Whether to support html fallback. By default, when the request meets the following conditions and the corresponding resource is not found, it will fallback to index.html:

  • The request is a GET or HEAD request
  • Which accepts text/html (the request header accept type is text/html or */*)
export default {
  server: {
    htmlFallback: 'index',
  },
};
TIP

When htmlFallback cannot meet your needs, you can use server.historyApiFallback for more flexible settings.