浼潤鎬亀eb.config甯歌瑙勫垯鍐欐硶涓庡弬鏁颁粙缁嶈鏄.



绀轰緥1锛

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="瑙勫垯 1" stopProcessing="true">
                    <match url="^includes/(.*)" />
                    <action type="Rewrite" url="includes\/{R:1}" />
                </rule>
    <rule name="瑙勫垯 2" stopProcessing="true">
                    <match url="^(blog)/includes/(.*)" />
                    <action type="Rewrite" url="{R:1}/includes\/{R:2}" />
                </rule>
                <rule name="瑙勫垯 3" stopProcessing="true">
                    <match url="^(blog)/(.*).html(.*)" />
                    <action type="Rewrite" url="{R:1}/index.php\/{R:2}.html{R:3}" />
                </rule>
                <rule name="瑙勫垯 4" stopProcessing="true">
                    <match url="^(.*).html(.*)" />
                    <action type="Rewrite" url="index.php\/{R:1}.html{R:2}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

绀轰緥2锛

<?xml version="1.0" encoding="UTF-8"?>
 
<configuration>
 
  <system.webServer>
 
    <rewrite>
 
      <rules>
 
        <rule name="Imported Rule 1">
 
          <match url="list-([0-9]+)\.html" ignoreCase="false"/>
 
          <action type="Rewrite" url="plus/list.php?tid={R:1}" appendQueryString="false"/>
 
        </rule>
 
        <rule name="Imported Rule 2">
 
          <match url="list-([0-9]+)-([0-9]+)-([0-9]+)\.html" ignoreCase="false"/>
 
          <action type="Rewrite" url="plus/list.php?tid={R:1}&TotalResult={R:2}&PageNo={R:3}" appendQueryString="false"/>
 
        </rule>
 
        <rule name="Imported Rule 3">
 
          <match url="view-([0-9]+)-([0-9]+)\.html" ignoreCase="false"/>
 
          <action type="Rewrite" url="plus/view.php?arcID={R:1}&pageno={R:2}" appendQueryString="false"/>
 
        </rule>
 
      </rules>
 
    </rewrite>
 
  </system.webServer>
 
</configuration>

绀轰緥3锛

<?xml version="1.0" encoding="UTF-8"?>
 
<configuration>
 
  <system.webServer>
 
    <rewrite>
 
      <rules>
 
        <rule name="portal_topic">
 
          <match url="^(.*/)*topic-(.+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/portal.php?mod=topic&topic={R:2}&{R:3}"/>
 
        </rule>
 
        <rule name="portal_article">
 
          <match url="^(.*/)*article-([0-9]+)-([0-9]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/portal.php?mod=view&aid={R:2}&page={R:3}&{R:4}"/>
 
        </rule>
 
        <rule name="forum_forumdisplay">
 
          <match url="^(.*/)*forum-(\w+)-([0-9]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/forum.php?mod=forumdisplay&fid={R:2}&page={R:3}&{R:4}"/>
 
        </rule>
 
        <rule name="forum_viewthread">
 
          <match url="^(.*/)*thread-([0-9]+)-([0-9]+)-([0-9]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/forum.php?mod=viewthread&tid={R:2}&extra=page%3D{R:4}&page={R:3}&{R:5}"/>
 
        </rule>
 
        <rule name="group_group">
 
          <match url="^(.*/)*group-([0-9]+)-([0-9]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/forum.php?mod=group&fid={R:2}&page={R:3}&{R:4}"/>
 
        </rule>
 
        <rule name="home_space">
 
          <match url="^(.*/)*space-(username|uid)-(.+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/home.php?mod=space&{R:2}={R:3}&{R:4}"/>
 
        </rule>
 
        <rule name="home_blog">
 
          <match url="^(.*/)*blog-([0-9]+)-([0-9]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/home.php?mod=space&uid={R:2}&do=blog&id={R:3}&{R:4}"/>
 
        </rule>
 
        <rule name="forum_archiver">
 
          <match url="^(.*/)*(fid|tid)-([0-9]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/index.php?action={R:2}&value={R:3}&{R:4}"/>
 
        </rule>
 
        <rule name="plugin">
 
          <match url="^(.*/)*([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+).html\?*(.*)$"/>
 
          <action type="Rewrite" url="{R:1}/plugin.php?id={R:2}:{R:3}&{R:4}"/>
 
        </rule>
 
      </rules>
 
    </rewrite>
 
  </system.webServer>
 
</configuration>

鎻愮ず1銆<rule>鑺傜偣鐨刵ame涓嶈兘閲嶅銆

鎻愮ず2銆<match>閲岀殑url鏄竴涓鍒欒〃杈惧紡锛屽疄渚嬮噷^(.*)t/([0-9,a-z]*)鏄竴涓父鐢ㄧ殑鍙ュ紡銆

^鍖归厤鍩熷悕寮澶达紝濡傦細http://u.odweb.cn/锛屾敞鎰忓煙鍚嶅悗闈㈡湁涓枩鏉/銆

(.*)鍖归厤浠讳綍瀛楃銆

([0-9,a-z]*)鍖归厤浠讳綍鏁板瓧鍜屽瓧姣嶃

鍥犳锛宆(.*)t/([0-9,a-z]*) 鍙互鍖归厤濡備笅鐨勮闂綉鍧锛堝亣濡傜綉绔欏煙鍚嶆槸u.odweb.cn锛夛細

鎻愮ず3銆<action type="Rewrite" ...>琛ㄧず鎵ц鐨勭被鍨嬫槸閲嶅啓锛岄噷闈㈢殑url鏄疄闄呯綉鍧锛寋R:1}/list.asp?id={R:2} 鐨勮В閲婂涓嬶細

{R:1}瀵瑰簲<match>閲岀殑url鐨勭涓涓嫭鍙峰唴瀹癸紝{R:2}瀵瑰簲<match>閲岀殑url鐨勭浜屼釜鎷彿鍐呭锛屽鏋滄湁{R:3}銆亄R:4}锛屽姝ょ被鎺ㄣ

鎵浠ワ紝濡傛灉鍋囧鐢ㄦ埛璁块棶鐨勭綉鍧鏄

http://u.odweb.cn/t/123
http://u.odweb.cn/news/t/a1
閭d箞锛屽叾瀵瑰簲鐨勫疄闄呯綉鍧鏄

http://u.odweb.cn/news_show.asp?id=123
http://u.odweb.cn/news/news_show.asp?id=a1
鎻愮ず4銆佹寜鐓т笂闈㈢殑瑙i噴锛屼綘搴旇宸笉澶氳兘璇绘噦瀹炰緥鐨剅ule2閲嶅啓瑙勫垯浜嗐

$锛岃繖鏄釜缁撴潫绗︼紝琛ㄧず鍖归厤鐨剈rl鍒版缁撴潫锛屽悗闈㈡病鏈夊叾浠栧瓧绗︿簡銆

([0-9]+) 琛ㄧず鍖归厤浠讳綍鏁板瓧銆

\.html 琛ㄧず鍖归厤 .html銆

\?琛ㄧず鍖归厤涓涓棶鍙?銆

鐗瑰埆瑕佹敞鎰忥紝鍙嶆枩鏉燶鏄浆涔夌锛屽洜涓烘鍒欒〃杈惧紡閲岋紝涓鐐.鏄〃绀哄尮閰嶄换浣曞瓧绗︾殑鎰忔濓紝鎵浠ヨ鍔犱笂鍙嶆枩鏉犲鍏惰浆涔夛紝杩欐牱鎵嶈〃绀哄尮閰嶇殑鏄竴涓偣.銆

鍚屾牱鍦帮紝闂彿?涔熸槸涓涓厓绗﹀彿锛屽畠琛ㄧず鍖归厤鍓嶉潰鐨勫瓙琛ㄨ揪寮忛浂娆℃垨涓娆★紝鍥犳锛屼篃闇瑕佸湪鍏跺墠闈㈠姞涓婅浆涔夌\锛岃繖鎵嶈〃绀哄尮閰嶇殑鏄竴涓棶鍙?銆

鎻愮ず5銆佸叾浠

ignoreCase="false" 琛ㄧず涓嶈兘蹇界暐澶у皬鍐欙紝濡傛灉璇ュ艰涓簍rue锛屽垯琛ㄧず蹇界暐澶у皬鍐欍

appendQueryString="false" 琛ㄧず涓嶄娇鐢╱rl鍙傛暟銆




浠ヤ笂灏辨槸浼潤鎬亀eb.config URL閲嶅啓鍙傛暟璇﹁В鐨勮缁嗗唴瀹癸紝鏇村淇℃伅璇峰叧娉∣D浜戝叾瀹冪浉鍏虫枃绔狅紒



鏈枃URL锛http://www.odweb.cn/news_show.html?id=230