千万个美丽的未来,抵不上一个温暖的现在,每一个真实的现在,都是我们曾经幻想的未来!
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]
Apr 21
<configuration>
  
    <system.webServer>
        <httpErrors errorMode="Detailed" />
        <asp scriptErrorSentToBrowser="true"/>
  <rewrite>
    <rules>
      <rule name="Rewrite subdomain">
        <match url="(.*)" />
         <conditions>
          <add input="{HTTP_HOST}" pattern="^yourdomain\.com$" />
         </conditions>
         <action type="Redirect"  url="http://www.yourdomain.com/{R:1}" appendQueryString="false"/>
      </rule>
      <rule name="From Ultimate SEO URLs 1" stopProcessing="true">
            <match url="^(.*)-p-(.*).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=product_info&amp;products_id={R:2}&amp;" appendQueryString="true" />
       </rule>
    
      <rule name="From Ultimate SEO URLs 2" stopProcessing="true">
            <match url="^(.*)-c-(.*).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=index&amp;cPath={R:2}&amp;" appendQueryString="true" />
       </rule>
      
       <rule name="From Ultimate SEO URLs 3" stopProcessing="true">
            <match url="^(.*)-m-([0-9]+).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=index&amp;manufacturers_id={R:2}&amp;" appendQueryString="true" />
       </rule>
      
       <rule name="From Ultimate SEO URLs 4" stopProcessing="true">
            <match url="^(.*)-pi-([0-9]+).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=popup_image&amp;pID={R:2}&amp;" appendQueryString="true" />
       </rule>
        <rule name="From Ultimate SEO URLs 5" stopProcessing="true">
            <match url="^(.*)-pr-([0-9]+).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=product_reviews&amp;products_id={R:2}&amp;" appendQueryString="true" />
       </rule>
       <rule name="From Ultimate SEO URLs 6" stopProcessing="true">
            <match url="^(.*)-pri-([0-9]+).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=product_reviews_info&amp;products_id={R:2}&amp;" appendQueryString="true" />
       </rule>
      
      <rule name="For Open Operations Info Manager" stopProcessing="true">
            <match url="^(.*)-i-([0-9]+).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=info_manager&amp;pages_id={R:2}&amp;" appendQueryString="true" />
       </rule>
      
       <rule name="For dreamscape's News and Articles Manager 1" stopProcessing="true">
            <match url="^news/?$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news&amp;" appendQueryString="true" />
       </rule>
       <rule name="For dreamscape's News and Articles Manager 2" stopProcessing="true">
            <match url="^news/rss.xml$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news_rss&amp;" appendQueryString="true" />
       </rule>  
       <rule name="For dreamscape's News and Articles Manager 3" stopProcessing="true">
            <match url="^news/archive/?$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news_archive&amp;" appendQueryString="true" />
       </rule>
       <rule name="For dreamscape's News and Articles Manager 4" stopProcessing="true">
            <match url="^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news&amp;date={R:1}-{R:2}-{R:3}&amp;" appendQueryString="true" />
       </rule>
           <rule name="For dreamscape's News and Articles Manager 5" stopProcessing="true">
            <match url="^news/archive/([0-9]{4})-([0-9]{2}).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news_archive&amp;date={R:1}-{R:2}&amp;" appendQueryString="true" />
       </rule>
      <rule name="For dreamscape's News and Articles Manager 6" stopProcessing="true">
            <match url="^news/(.*)-a-([0-9]+)-comments.html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news_comments&amp;article_id={R:2}&amp;" appendQueryString="true" />
       </rule>
       <rule name="For dreamscape's News and Articles Manager 7" stopProcessing="true">
            <match url="^news/(.*)-a-([0-9]+).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page=news_article&amp;article_id={R:2}&amp;" appendQueryString="true" />
       </rule>
      
      
      
       <rule name="All other pages" stopProcessing="true">
            <match url="^(.*).html$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?main_page={R:1}&amp;" appendQueryString="true" />
       </rule>
     </rules>
    </rewrite>
    </system.webServer>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true"/>
    </system.web>
</configuration>
Tags: , ,
Nov 30
1、右键“计算机”,点击“管理”

2、添加角色


3、添加角色服务

如果你的程序在IIS7下出错,记得选择服务的时候添加IIS6兼容模块,如果无问题,这个可以不用选择;

4、打开“处理程序映射”
选择“添加模块映射”,添加你PHP目录中的php-cgi;

5、选择fastcgi配置(注意,这里如果是IIS7,则需要手动安装Administration Pack for IIS 7.0 ,如果是IIS7.5,则无需下载,IIS7.5已经集成此功能);
点击“Edit.。.”,则弹出如下图:

添加:PHP_FCGI_MAX_REQUESTS , value 数值10000;



进入你PHP的存放目录,复制一份php.ini-disk,改名为php.ini;


fastcgi.impersonate = 1
cgi.fix_pathinfo=1
cgi.force_redirect = 0
以上3个前的;去掉,并修改以上相应数值,如下图所示:
这样就可以完整的运行PHP了,可以用

<?php phpinfo();?>

测试是否正常;
以上PHP的配置,只是配置以fastcgi模式运行php,其他详细PHP.INI的配置跟原来IIS6中isapi的一样,可以照搬,网上教程一大把,我就不废话了。
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>
Tags: , , ,
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>
Tags: , , ,
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>
Tags: , , ,
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]