Skip to content

apache .htaccess not working with lazy-loaded routes #2753

@xseignard

Description

@xseignard

Version

3.0.3

Reproduction link

https://beta.pow.cool/members

Steps to reproduce

  • Create a new app
  • Add a lazy loaded route named 'myRoute'
  • Build it
  • Check that you have a myRoute.js file in your build folder
  • Deploy it to an apache server after following the .htaccess recommandation in the vue-router docs
  • Check that your browser shows the content of the myRoute.js file instead of serving the index.html file when browsing http://mysite.com/myRoute

What is expected?

The browser shoud display the index.html at the given route.

What is actually happening?

The browser displays the js content of the javascript file.


It works as expected with the following conf (taken from create-react-app):

Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions