欢迎访问我的博客 https://javascript.shop

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>

posted @ 2017-07-14 00:56  孑孓子  阅读(594)  评论(0编辑  收藏  举报
欢迎访问我的博客 https://javascript.shop