apache的配置html
这是windows下的apache
在httpd-vhosts.conf文件中把目录指向项目index.html文件所在的位置windows
# Virtual Hosts # <VirtualHost *:80> ServerName localhost DocumentRoot D:/wamp64/www/huanzuan/dist <Directory "D:/wamp64/www/huanzuan/dist"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
而后再 index.html文件的同级路径下 建立.htaccess文件ide
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
内容就是官方文档给的 一点都不用改ui
而后确保 config/index.js中的build下的code
assetsPublicPath: '/',
是绝对路径就能够了htm