Apache伪静态规则如下:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
转换后的Nginx规则如下:
# nginx configuration by winginx.com location ~ ^/index\.html$ { } location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.html break; } }
转换工具推荐:https://winginx.com/en/htaccess;