将isapi重写规则转换为IIS 7重写 [英] Convert isapi rewrite rules to IIS 7 rewrite
本文介绍了将isapi重写规则转换为IIS 7重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在vBulletin论坛上使用带有vbSEO的helicon isapi重写.如果使用的是IIS 7,我看不到需要使用单独的isapi重写工具.重写规则和regex不是我的强项.如果有人可以帮助我将下面的信息转换为IIS 7 URL重写配置,我将不胜感激.
I am using helicon isapi rewrite with vbSEO on vBulletin forums. I don't see any need to be using a separate isapi rewrite tool if I'm using IIS 7. Rewrite rules and regex are not my strength. If anyone can help me convert the info below into an IIS 7 url rewrite configuration I would greatly appreciate it.
谢谢.
RewriteCond %{HTTP_HOST} .*vbdotnetforums.com
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{HTTP_HOST} .*vbdotnetforums.com
RewriteCond %{REQUEST_URI} !/(admincp/|modcp/|cron)
RewriteRule ^/((archive/)?(.*\.php(/.*)?))$ /vbseo.php?vbseourl=$1 [L,QSA]
RewriteCond %{HTTP_HOST} .*vbdotnetforums.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^/(admincp|modcp|clientscript|cpstyles|images|search\.php|api\.php)/
RewriteRule ^/(.+)$ /vbseo.php?vbseourl=$1 [L,QSA]
推荐答案
这是怎么回事:
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$" />
<conditions>
<add input="{HTTP_HOST}" pattern=".*vbdotnetforums.com" />
</conditions>
<action type="Rewrite" url="vbseo_sitemap/vbseo_getsitemap.php?sitemap={R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^((archive/)?(.*\.php(/.*)?))$" />
<conditions>
<add input="{HTTP_HOST}" pattern=".*vbdotnetforums.com" />
<add input="{URL}" pattern="/(admincp/|modcp/|cron)" negate="true" />
</conditions>
<action type="Rewrite" url="/vbseo.php?vbseourl={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^(.+)$" />
<conditions>
<add input="{HTTP_HOST}" pattern=".*vbdotnetforums.com" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="^/(admincp|modcp|clientscript|cpstyles|images|search\.php|api\.php)/" negate="true" />
</conditions>
<action type="Rewrite" url="/vbseo.php?vbseourl={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
您是否知道可以使用IIS7的管理控制台导入ISAPI_Rewrite规则(基于mod_rewrite
)?
Did you know that you can import ISAPI_Rewrite rules (which are based on mod_rewrite
) using IIS7's management console?
这篇关于将isapi重写规则转换为IIS 7重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文