ISAPI_Rewrite中httpd.ini的写法为:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteRule ^(.*).html /index\.php\?do=$1&%{QUERY_STRING} [L]
RewriteRule ^(w+).html /index\.php\?do=$1&%{QUERY_STRING} [L]
而Mod_Rewrite中.htaccess的写法是:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule (.*\.html)$ index\.php\?do=%{HTTP_HOST}/$1&%{QUERY_STRING} [L]
RewriteRule (^\w+\/?)$ index\.php\?do=%{HTTP_HOST}/$1&%{QUERY_STRING} [L]
</IfModule>
除了基本的正则外,只是在ISAPI_Rewrite用$而Mod_Rewrite用%
本文对比了ISAPI_Rewrite与Mod_Rewrite两种URL重写方式的具体配置方法,前者适用于Windows平台的IIS服务器,后者则常用于Apache服务器。通过示例详细解析了两种方式下如何实现URL的重定向及简化。
308

被折叠的 条评论
为什么被折叠?



