日期:2014-05-17  浏览次数:20865 次

求把下面apache .htaccess 转换到IIS ISAPI_Rewrite的 httpd.ini
求把下面apache .htaccess 转换到IIS ISAPI_Rewrite的 httpd.ini 

RewriteRule ^/?$ %{HTTP_HOST} 
RewriteRule ([^.]+)\.11111.com(.*) yp/web/index.php

------解决方案--------------------
这是在Linux下面Apaches下的站点.htaccess 内容

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule News-([a-zA-Z0-9\-\+\&\_]{1,})-([0-9]{1,})\.html$ news.php?action=$1&aid=$2
RewriteRule ([a-zA-Z0-9]{1,})-([0-9]{1,})\.html$ product_infor.php?action=$1&itemno=$2
RewriteRule ([a-zA-Z0-9\-\_\&\+]{1,})\.html$ product.php?cate_name=$1
</IfModule>

转换到 iis 的isap_rewrite的 httpd.ini 格式如下:

[ISAPI_Rewrite]
RewriteRule /News-([a-zA-Z0-9\-\+\&\_]{1,})-([0-9]{1,})\.html /news.php\?action=$1&aid=$2 [I,L]
RewriteRule /.*([a-zA-Z0-9]{1,})-([0-9]{1,})\.html /product_infor.php\?action=$1&itemno=$2 [I,L]
RewriteRule /([a-zA-Z0-9\-\_\&\+]{1,}).html /product.php\?cate_name=$1 [I,L]

 

这里要注意2点
1. 前面要加上 /

2. 在转换地址 要注意 问号转义下。 \?