千万个美丽的未来,抵不上一个温暖的现在,每一个真实的现在,都是我们曾经幻想的未来!
Nov
30
把以下代码复制到网站目录中的配置文件web.config中的 <system.webServer>之后就可以了。
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^archiver/((fid|tid)-[\w\-]+\.html)$" ignoreCase="false" />
<action type="Rewrite" url="archiver/index.php?{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="^forum-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="forumdisplay.php?fid={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3">
<match url="^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="viewthread.php?tid={R:1}&extra=page\%3D{R:3}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 4">
<match url="^space-(username|uid)-(.+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="space.php?{R:1}={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5">
<match url="^tag-(.+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="tag.php?name={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="^archiver/((fid|tid)-[\w\-]+\.html)$" ignoreCase="false" />
<action type="Rewrite" url="archiver/index.php?{R:1}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="^forum-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="forumdisplay.php?fid={R:1}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3">
<match url="^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="viewthread.php?tid={R:1}&extra=page\%3D{R:3}&page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 4">
<match url="^space-(username|uid)-(.+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="space.php?{R:1}={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5">
<match url="^tag-(.+)\.html$" ignoreCase="false" />
<action type="Rewrite" url="tag.php?name={R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
Nov
30
今天把所有的网站都移植到了windows server 2008的服务器上了,因为微软已经有了URL Rewrite这个模块了,就不需要安装ISAPI_Rewrite了,但是URL Rewrite的规则和ISAPI_Rewrite的有些不一样了,用了ISAPI_Rewrite的规则之后IIS提示404错误,于是参照了官方的帮助文件,终于把新云4.0的伪静态规则搞定了,在自己的网站测试一切正常,把以下代码复制到网站的配置文件web.config中的<system.webServer>之后就可以了。
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="([A-Za-z0-9_-]+)/(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="{R:1}/show.asp?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="([A-Za-z0-9_-]+)/(\d+)_(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/show.asp?id={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3">
<match url="([A-Za-z0-9_-]+)/list_(\d+)_(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/list.asp?page={R:2}&classid={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 4">
<match url="([A-Za-z0-9_-]+)/special-(\d+)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/special.asp?page={R:2}&specialid={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5">
<match url="([A-Za-z0-9_-]+)/newlist-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/shownew.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 6">
<match url="([A-Za-z0-9_-]+)/bestlist-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showbest.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 7">
<match url="([A-Za-z0-9_-]+)/hotlist-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showhot.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 8">
<match url="([A-Za-z0-9_-]+)/ABC_([A-Za-z0-9_-]+)_1\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showabc.asp?q={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 9">
<match url="([A-Za-z0-9_-]+)/tag-(.*)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/tag.asp?name={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 10">
<match url="([A-Za-z0-9_-]+)/tag-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/tag.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 11">
<match url="([A-Za-z0-9_-]+)/Soft(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/softdown.asp?softid={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 12">
<match url="([A-Za-z0-9_-]+)/d(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/down.asp?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 13">
<match url="([A-Za-z0-9_-]+)/type-(.*)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showtype.asp?type={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 14">
<match url="([A-Za-z0-9_-]+)/comment-(\d+)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/comment.asp?id={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 15">
<match url="([A-Za-z0-9_-]+)/fx-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/downcopy.asp?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 16">
<match url="support/about.html" ignoreCase="false" />
<action type="Rewrite" url="/support/about.asp" />
</rule>
<rule name="Imported Rule 17">
<match url="support/advertise.html" ignoreCase="false" />
<action type="Rewrite" url="/support/advertise.asp" />
</rule>
<rule name="Imported Rule 18">
<match url="support/help.html" ignoreCase="false" />
<action type="Rewrite" url="/support/help.asp" />
</rule>
<rule name="Imported Rule 19">
<match url="support/contact.html" ignoreCase="false" />
<action type="Rewrite" url="/support/contact.asp" />
</rule>
<rule name="Imported Rule 20">
<match url="support/copyright.html" ignoreCase="false" />
<action type="Rewrite" url="/support/copyright.asp" />
</rule>
<rule name="Imported Rule 21">
<match url="support/declare.html" ignoreCase="false" />
<action type="Rewrite" url="/support/declare.asp" />
</rule>
<rule name="Imported Rule 22">
<match url="support/juanzhu.html" ignoreCase="false" />
<action type="Rewrite" url="/support/juanzhu.asp" />
</rule>
</rules>
</rewrite>
<rewrite>
<rules>
<rule name="Imported Rule 1">
<match url="([A-Za-z0-9_-]+)/(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="{R:1}/show.asp?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 2">
<match url="([A-Za-z0-9_-]+)/(\d+)_(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/show.asp?id={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 3">
<match url="([A-Za-z0-9_-]+)/list_(\d+)_(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/list.asp?page={R:2}&classid={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 4">
<match url="([A-Za-z0-9_-]+)/special-(\d+)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/special.asp?page={R:2}&specialid={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 5">
<match url="([A-Za-z0-9_-]+)/newlist-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/shownew.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 6">
<match url="([A-Za-z0-9_-]+)/bestlist-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showbest.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 7">
<match url="([A-Za-z0-9_-]+)/hotlist-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showhot.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 8">
<match url="([A-Za-z0-9_-]+)/ABC_([A-Za-z0-9_-]+)_1\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showabc.asp?q={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 9">
<match url="([A-Za-z0-9_-]+)/tag-(.*)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/tag.asp?name={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 10">
<match url="([A-Za-z0-9_-]+)/tag-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/tag.asp?page={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 11">
<match url="([A-Za-z0-9_-]+)/Soft(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/softdown.asp?softid={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 12">
<match url="([A-Za-z0-9_-]+)/d(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/down.asp?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 13">
<match url="([A-Za-z0-9_-]+)/type-(.*)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/showtype.asp?type={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 14">
<match url="([A-Za-z0-9_-]+)/comment-(\d+)-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/comment.asp?id={R:2}&page={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 15">
<match url="([A-Za-z0-9_-]+)/fx-(\d+)\.html" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}/downcopy.asp?id={R:2}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 16">
<match url="support/about.html" ignoreCase="false" />
<action type="Rewrite" url="/support/about.asp" />
</rule>
<rule name="Imported Rule 17">
<match url="support/advertise.html" ignoreCase="false" />
<action type="Rewrite" url="/support/advertise.asp" />
</rule>
<rule name="Imported Rule 18">
<match url="support/help.html" ignoreCase="false" />
<action type="Rewrite" url="/support/help.asp" />
</rule>
<rule name="Imported Rule 19">
<match url="support/contact.html" ignoreCase="false" />
<action type="Rewrite" url="/support/contact.asp" />
</rule>
<rule name="Imported Rule 20">
<match url="support/copyright.html" ignoreCase="false" />
<action type="Rewrite" url="/support/copyright.asp" />
</rule>
<rule name="Imported Rule 21">
<match url="support/declare.html" ignoreCase="false" />
<action type="Rewrite" url="/support/declare.asp" />
</rule>
<rule name="Imported Rule 22">
<match url="support/juanzhu.html" ignoreCase="false" />
<action type="Rewrite" url="/support/juanzhu.asp" />
</rule>
</rules>
</rewrite>
Nov
30
wordpress 官方已经内置了 IIS7 URL Rewrite 的支持,但对于中文用户来说,官方内置的伪静态规则不能完好的支持中文tag的问题。虽然可以更改系统文件来解决,但比较麻烦,而且不方便,所以一直没介绍过。现在帖出一个自用的的规则,可以解决wordpress的中文tag的问题。
将下列代码加入到web目录下的web.config文件的<system.webServer>之后即可。
<rewrite>
<rules>
<clear />
<rule name="wordpress2.7" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
<rule name="chinese tag" stopProcessing="true">
<match url="/tag/(.*)" />
<conditions logicalGrouping="MatchAll" />
<action type="Rewrite" url="/index\.php\?tag={R:1}" />
</rule>
</rules>
</rewrite>
将下列代码加入到web目录下的web.config文件的<system.webServer>之后即可。
<rewrite>
<rules>
<clear />
<rule name="wordpress2.7" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
<rule name="chinese tag" stopProcessing="true">
<match url="/tag/(.*)" />
<conditions logicalGrouping="MatchAll" />
<action type="Rewrite" url="/index\.php\?tag={R:1}" />
</rule>
</rules>
</rewrite>