适用于Apache,Lighttpd,IIS,Nginx环境下Rewrite伪静态规则,可正向或反向转换。

to Nginx

Apache rewrite rule: Wordpress
RewriteRule ^store-([0-9]+)\.html$ store.php?id=$1
Nginx rewrite rule: Wordpress , Magento , Discuz!X
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
if (!-e $request_filename) {
    return 404;
}
IIS7 rewrite rule: Discuz!X
<rule name="forum_viewthread">
<match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$" />
<action type="Rewrite" url="{R:1}/forum.php\?mod=viewthread&amp;tid={R:2}&amp;extra=page%3D{R:4}&amp;page={R:3}&amp;{R:5}" />
</rule>