午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    Discuz! X2子目錄偽靜態(tài)的實(shí)現(xiàn)方法
    來源:易賢網(wǎng) 閱讀:980 次 日期:2014-09-04 14:46:16
    溫馨提示:易賢網(wǎng)小編為您整理了“Discuz! X2子目錄偽靜態(tài)的實(shí)現(xiàn)方法”,方便廣大網(wǎng)友查閱!

    前幾天幫人實(shí)現(xiàn)Discuz X2的子目錄偽靜態(tài),以前沒做過,就去查了下百度和Discuz論壇,發(fā)現(xiàn)好多人都在找這樣的偽靜態(tài)方法,可是都沒真正能解決的方法。

    Discuz X2現(xiàn)在用的人還是比較多的,我不知道有多少人用的是IIS7的,用Apache的就好辦一些,因?yàn)?hacess是可以設(shè)置子目錄的偽靜態(tài)規(guī)則的,但是 在IIS7下,webconfig究竟怎么放才能實(shí)現(xiàn)子目錄偽靜態(tài)沒有試過,我百度的時(shí)候還有人說IIS7是Discuz X2的非主流環(huán)境。

    下面我就說一下在IIS7下如何實(shí)現(xiàn)Discuz X2的子目錄偽靜態(tài)。

    首先說明一下,在IIS7下我們自己測(cè)試的時(shí)候之所以不能實(shí)現(xiàn),大部分是因?yàn)槲覀儼褌戊o態(tài)的文件放在子目錄了,造成主目錄的規(guī)則跟子目錄相互沖突。

    還有一些是在子目錄消除了主目錄的偽靜態(tài)繼承,但是依舊打不開。

    我通過多次測(cè)試發(fā)現(xiàn),IIS7下的子目錄偽靜態(tài),規(guī)則要放在主目錄,而且規(guī)則的寫法不能跟主目錄的規(guī)則沖突。我這里就不說那么多理論了。直接發(fā)規(guī)則:

    <?xml version="1.0" encoding="UTF-8"?>

    <configuration>

    <system.webServer>

    <rewrite>

    <rules>

    <rule name="WWW 301Redirect" stopProcessing="true"> // 301跳轉(zhuǎn)規(guī)則

    <match url=".*" />

    <conditions>

    <add input="{HTTP_HOST}" pattern="^domain.comg$" />

    </conditions>

    <action type="Redirect" url="http://www.domain.com/{R:0}" redirectType="Permanent" />

    </rule>

    <rule name="portal_topic"> // 論壇規(guī)則開始

    <match url="^(.*)/topic-(.+).html?*(.*)$" />

    <action type="Rewrite" url="{R:1}/portal.php?mod=topic&amp;topic={R:2}&amp;{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&amp;aid={R:2}&amp;page={R:3}&amp;{R:4}" />

    </rule>

    <rule name="forum_forumdisplay">

    <match url="^(.*)/forum-(w+)-([0-9]+).html?*(.*)$" />

    <action type="Rewrite" url="{R:1}/forum.php?mod=forumdisplay&amp;fid={R:2}&amp;page={R:3}&amp;{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&amp;tid={R:2}&amp;extra=page%3D{R:4}&amp;page={R:3}&amp;{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&amp;fid={R:2}&amp;page={R:3}&amp;{R:4}" />

    </rule>

    <rule name="home_space">

    <match url="^(.*)/space-(username|uid)-(.+).html?*(.*)$" />

    <action type="Rewrite" url="{R:1}/home.php?mod=space&amp;{R:2}={R:3}&amp;{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&amp;uid={R:2}&amp;do=blog&amp;id={R:3}&amp;{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}&amp;value={R:3}&amp;{R:4}" />

    </rule> //論壇規(guī)則結(jié)束

    <rule name="wordpress" patternSyntax="Wildcard"> // WP偽靜態(tài)規(guī)則開始

    <match url="*" />

    <conditions>

    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />

    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

    <add input="{REQUEST_URI}" pattern="^/bbs1" negate="true" />

    </conditions>

    <action type="Rewrite" url="index.php" />

    </rule>

    </rules>

    </rewrite>

    </system.webServer>

    </configuration>

    基本上這個(gè)規(guī)則的子目錄已經(jīng)確定是bbs了,實(shí)在不會(huì)的朋友直接抄襲吧。

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看CMS教程
    易賢網(wǎng)手機(jī)網(wǎng)站地址:Discuz! X2子目錄偽靜態(tài)的實(shí)現(xiàn)方法
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
    相關(guān)閱讀CMS教程

    2025國考·省考課程試聽報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)