加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

vue-cli 打包使用history模式的后端配置实例

发布时间:2020-12-16 23:31:07 所属栏目:百科 来源:网络整理
导读:apache的配置 这是windows下的 在httpd-vhosts.conf文件中把目录指向项目index.html文件所在的位置 ServerName localhostDocumentRoot D:/wamp64/www/huanzuan/dist 然后再 index.html文件的同级路径下 创建.htaccess文件 RewriteEngine On RewriteBase / Re

apache的配置

这是windows下的

在httpd-vhosts.conf文件中把目录指向项目index.html文件所在的位置

ServerName localhost DocumentRoot D:/wamp64/www/huanzuan/dist

然后再 index.html文件的同级路径下 创建.htaccess文件

RewriteEngine On RewriteBase / RewriteRule ^index.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L]

内容就是官方文档给的 一点都不用改

然后确保 config/index.js中的build下的

以上这篇vue-cli 打包使用history模式的后端配置实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持编程之家。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读