
**二、服務器配置**
打包好H5代碼上傳到服務器還需要做偽靜態的配置。
history模式下配置nginx
~~~text
location / {
try_files $uri $uri/ /index.html;
}
~~~
history模式下配置Apache
~~~text
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
~~~