history模式下服务器配置
Apache
<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteRule ^index\.html$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.html [L]</IfModule>
除了mod_rewrite,你也可以使用FallbackResource。
nginx
# 防止 xhr 请求被拦截 设置匹配路径location ~* /(pages/|subPackages/) {try_files $uri $uri/ /index.html;}
