我在本地计算机上使用 xampp apache 服务器。
我尝试了
npm run preview
和serve -s dist
。它可以访问,但你必须在项目名称后面添加一个端口localhost:3000
类似这样。
我还尝试将 dist 文件夹复制到 xampps htdocs (system_name) 中的另一个文件夹
system_name/dist
。
我想像localhost/system_name
一样访问。当我尝试访问它时,它会出现白屏。我已经配置了 .htaccess
并仔细检查了指向 js 和 css 文件的 src 和 href。
我的 htaccess 文件也是这样的。
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.html [QSA,L]
RewriteCond %{REQUEST_URI} index.html$1
有什么办法可以做到这一点吗?