zoukankan      html  css  js  c++  java
  • godaddy虚拟空间的伪静态配置

    原文发布时间为:2011-02-24 —— 来源于本人的百度文章 [由搬家工具导入]

    只要在web.config文件的<configuration>子节点下 加入以下节点,即可实现 伪静态。正则自己写

    <system.webServer>
        <rewrite>
          <rules>
            <rule name="Rewrite to Detail">
              <match url="^house/(d{1,10})$"  ignoreCase="false" />
              <action type="Rewrite" url="/Detail.aspx?id={R:1}"  appendQueryString="false"/>
            </rule>
          </rules>
        </rewrite>
      </system.webServer>

    如 :http://sofunz.com/Detail.aspx?id=18413 我通过上面的方式伪静态成了 http://sofunz.com/house/18413

    ========更多配置范例如下======

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
           <rewrite>
                <rules>
                    <rule name="Imported Rule 17">
                        <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 18">
                        <match url="^forum-([0-9]+)-([0-9]+).html$" ignoreCase="false" />
                        <action type="Rewrite" url="forumdisplay.php?fid={R:1}&amp;page={R:2}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 19">
                        <match url="^thread-([0-9]+)-([0-9]+)-([0-9]+).html$" ignoreCase="false" />
                        <action type="Rewrite" url="viewthread.php?tid={R:1}&amp;extra=page\%3D{R:3}&amp;page={R:2}" appendQueryString="false" />
                    </rule>
                    <rule name="Imported Rule 20">
                        <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 21">
                        <match url="^tag-(.+).html$" ignoreCase="false" />
                        <action type="Rewrite" url="tag.php?name={R:1}" appendQueryString="false" />
                    </rule>
                </rules>
            </rewrite>
      <httpErrors errorMode="Detailed" />
      <asp scriptErrorSentToBrowser="true" />
      </system.webServer>
    <system.web>
    <customErrors mode="Off" />
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="utf-8" />
    </system.web>
    </configuration>

  • 相关阅读:
    WEB安全 php+mysql5注入防御(一)
    Spring 整合 Quartz 实现动态定时任务(附demo)
    dubbo工作原理(3)
    dubbo服务降级(2)
    dubbo服务降级(1)
    程序员决对不能缺少产品思维
    GNUPG
    idea远程debug:tomcat
    基于JavaMail的Java邮件发送:复杂邮件发送
    使用javaMail发送简单邮件
  • 原文地址:https://www.cnblogs.com/handboy/p/7163947.html
Copyright © 2011-2022 走看看