Quasar在Apache服务器上以历史模式构建但它只加载index.html而不是路由器定义组件

kupeojn6  于 2022-11-16  发布在  Apache
关注(0)|答案(1)|浏览(131)

Quasar项目在开发模式下工作。但是在使用quasar构建命令构建之后。它只加载index.html。

g52tjvyc

g52tjvyc1#

你需要一个.htaccess文件(index.html的根目录),里面包含:

RewriteEngine On

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]

仔细阅读Access-Control-Allow-Origin参考https://httpd.apache.org/docs/2.4/howto/htaccess.html

相关问题