我构建了一个包含 Vue-Router 的 VUE CLI Web 应用程序,因此我应该将所有请求重写为 index.html 文件,如下所示:
RewriteEngine On RewriteRule ^(.*)$ ./index.html [L]
但是有一个问题,有两个文件夹 css 和 js 包含打包的 css 和 js > 的,由 Vue-CLI 自动生成。浏览器将发送如下请求:https://example.com/css/xyz.css,但正如上面重写的那样,Apache会回答index.html。 html 文件。例如 js 文件夹/文件
如何将所有请求重写为 index.html 但现有文件/文件夹,如 favicon.ico 或 Bootstrap css/js 文件或图片或 css/js 文件位于同一文件夹中?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号