IIS 和 Apache Rewrite的写法风格有区别

Apache:


<VirtualHost *:80>
ServerName localhost
#ServerAlias localhost


RewriteEngine on
RewriteRule ^/artist-(\d+).html$ /artist.php?id=$1
RewriteRule ^/theme-(\d+).html$ /theme.php?themeid=$1
RewriteRule ^/artist-list-(.+).html$ /artist_list.php?tp=$1
RewriteRule ^/theme-list.html$ /theme_list.php
</VirtualHost>

IIS:


# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O]

# Some custom rules
RewriteRule /artist-(\d+)\.html /artist\.php\?id=$1 [L]
RewriteRule /artist-list-(.+)\.html /artist_list\.php\?tp=$1 [L]
RewriteRule /theme-(\d+)\.html /theme\.php\?themeid=$1 [L]
RewriteRule /theme-list\.html /theme_list\.php [L]


你可能感兴趣的:(IIS 和 Apache Rewrite的写法风格有区别)