You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置Quasar项目在Apache虚拟主机上运行

在domain.local部署Quasar项目的Apache配置

以下是用于在domain.local及所有子域名上运行Quasar项目的Apache虚拟主机配置:

ServerName domain.local
ServerAlias *.domain.local
DocumentRoot /project/

<Directory "/project/">
    AllowOverride All
    Require all granted

    <IfModule mod_rewrite.c>
          RewriteEngine On
          RewriteBase /
          RewriteRule ^index\.html$ - [L]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule . /index.html [L]
    </IfModule>
</Directory>

配置要点说明

  • ServerName与ServerAlias指定站点主域名及所有子域名,确保*.domain.local的请求都指向该项目
  • DocumentRoot需指向Quasar项目打包后的输出目录,确认/project/下存在index.html及静态资源文件
  • 启用mod_rewrite是为了适配Quasar的SPA路由规则,将所有非文件、非目录的请求转发到index.html,避免路由跳转404
  • AllowOverride All允许通过.htaccess文件自定义额外的配置规则

内容的提问来源于stack exchange,提问作者user15539888

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 12:15:40