<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    贏在執行

    這個世界上只有兩樣東西愈分享愈多,那就是智慧與愛。

    BlogJava 首頁 新隨筆 聯系 聚合 管理
      17 Posts :: 11 Stories :: 13 Comments :: 0 Trackbacks
    關于Apache實現UrlRewrite靜態化頁面的配置
    2007年07月27日 星期五 22:56

    關于UrlRewrite靜態化的說明:

    (1)apache用戶,首先確認您的服務器是apache架設的web服務器(此插件只使用于apache架設的服務器)
    Apache Web Server(獨立主機用戶)
    首先確定您使用的 Apache 版本,及是否加載了 mod_rewrite 模塊。
    Apache 1.x 的用戶請檢查 conf/httpd.conf 中是否存在如下兩段代碼:
    LoadModule rewrite_module libexec/mod_rewrite.so
    AddModule mod_rewrite.c
    Apache 2.x 的用戶請檢查 conf/httpd.conf 中是否存在如下一段代碼:
    LoadModule rewrite_module modules/mod_rewrite.so
    如果存在,那么在配置文件(通常就是 conf/httpd.conf)中加入如下代碼。此時請務必注意,如果網站
    使用通過虛擬主機來定義,請務必加到虛擬主機配置,即 <VirtualHost> 中去,如果加在虛擬主機配置外
    部將可能無法使用。改好后然后將 Apache 重啟。

    <IfModule mod_rewrite.c>
                RewriteEngine On
                
    RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)-([0-9]+).html[?]{0,1}(.*)$ $1/forumdisplay.php
                ?f=$2&st=$4&pp=$3&$5
                RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+).html[?]{0,1}(.*)$ $1/forumdisplay.php?f=$2&pp=$3&$4
                RewriteRule ^(.*)/forum-([0-9]+)-(q?)-([0-9]+).html[?]{0,1}(.*)$ $1/forumdisplay.php
                ?f=$2&filter=quintessence&pp=$3&$4
                RewriteRule ^(.*)/forum-([0-9]+)-(q?).html[?]{0,1}(.*)$ $1/forumdisplay.php
                ?f=$2&filter=quintessence&$4
                RewriteRule ^(.*)/forum-([0-9]+).html[?]{0,1}(.*)$ $1/forumdisplay.php?f=$2&$3
                RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+).html[?]{0,1}(.*)$ $1/showthread.php?t=$2&pp=$3&$4
                RewriteRule ^(.*)/thread-([0-9]+).html[?]{0,1}(.*)$ $1/showthread.php?t=$2&$3
                RewriteRule ^(.*)/user-([0-9]+).html $1/profile.php?u=$2[L]
                RewriteRule ^(.*)/archive/f-([0-9]+)-([0-9]+).html $1/index.php?f$2-$3.html[L]
                RewriteRule ^(.*)/archive/t-([0-9]+)-([0-9]+).html $1/index.php?t$2-$3.html[L]
                </IfModule>
                如果沒有安裝 mod_rewrite,您可以重新編譯 Apache,并在原有 configure 的內容中加入
                --enable-rewrite=shared,然后再在 Apache 配置文件中加入上述代碼即可。 
    Apache Web Server(虛擬主機用戶)
    在開始以下設置之前,請首先咨詢您的空間服務商,空間是否支持 Rewrite 以及是否支持對站點
                目錄中 .htaccess 的文件解析,否則即便按照下面的方法設置好了,也無法使用。
                
    檢查論壇所在目錄中是否存在 .htaccess 文件,如果不存在,請手工建立此文件。Win32 系統下
                ,無法直接建立 .htaccess 文件,您可以從其他系統中拷貝一份,或者在 魔力論壇技術支持欄目
                中下載此文件。編輯并修改 .htaccess 文件,添加以下內容 :
                
    # 將 RewriteEngine 模式打開
                RewriteEngine On
                
    # 修改以下語句中的 /molyx_board 為你的論壇目錄地址,如果程序放在根目錄中,請將
                /molyx_board 修改為 /
                RewriteBase /molyx_board/
                # Rewrite 系統規則請勿修改
                RewriteRule forum-([0-9]+)-([0-9]+)-([0-9]+).html forumdisplay.php?f=$1&st=$3&pp=$2&$4
                RewriteRule forum-([0-9]+)-([0-9]+).html forumdisplay.php?f=$1&pp=$2&$3
                RewriteRule forum-([0-9]+)-(q?)-([0-9]+).html forumdisplay.php?f=$1&filter=quintessence&pp=$3
                RewriteRule forum-([0-9]+)-(q?).html forumdisplay.php?f=$1&filter=quintessence
                RewriteRule forum-([0-9]+).html forumdisplay.php?f=$1
                RewriteRule thread-([0-9]+)-([0-9]+).html showthread.php?t=$1&pp=$2&$3
                RewriteRule thread-([0-9]+).html showthread.php?t=$1&$2
                RewriteRule user-([0-9]+).html profile.php?u=$1
                RewriteRule archive/f-([0-9]+)-([0-9]+).html archive/index.php?f$1-$2.html
                RewriteRule archive/t-([0-9]+)-([0-9]+).html archive/index.php?t$1-$2.html
     
    以上為開啟URL靜態化的整個說明。
    本人是獨立主機,按照上面做,一直沒有成功。開啟靜態化后,提示
                

    The requested URL thread-11955.html was not found on this server

    困惑了一天,修改了很多次規則都不行。后來嘗試著結合虛擬主機用戶方法。首先把httpd.conf中的規則

    配置去掉,然后在論壇根目錄創建.htaccess 文件,然后把規則寫進去,重啟apache,一切OK啦。

    規則如下:

    <IfModule mod_rewrite.c>

    # 將 RewriteEngine 模式打開
                RewriteEngine On
                
    # 修改以下語句中的 /molyx_board 為你的論壇目錄地址,如果程序放在根目錄中,請將
                /molyx_board 修改為 /
                RewriteBase /molyx_board/
                # Rewrite 系統規則請勿修改
                RewriteRule forum-([0-9]+)-([0-9]+)-([0-9]+).html forumdisplay.php?f=$1&st=$3&pp=$2&$4
                RewriteRule forum-([0-9]+)-([0-9]+).html forumdisplay.php?f=$1&pp=$2&$3
                RewriteRule forum-([0-9]+)-(q?)-([0-9]+).html forumdisplay.php?f=$1&filter=quintessence&pp=$3
                RewriteRule forum-([0-9]+)-(q?).html forumdisplay.php?f=$1&filter=quintessence
                RewriteRule forum-([0-9]+).html forumdisplay.php?f=$1
                RewriteRule thread-([0-9]+)-([0-9]+).html showthread.php?t=$1&pp=$2&$3
                RewriteRule thread-([0-9]+).html showthread.php?t=$1&$2
                RewriteRule user-([0-9]+).html profile.php?u=$1
                RewriteRule archive/f-([0-9]+)-([0-9]+).html archive/index.php?f$1-$2.html
                RewriteRule archive/t-([0-9]+)-([0-9]+).html archive/index.php?t$1-$2.html

    </IfModule>

    posted on 2008-02-01 00:40 飛雪(leo) 閱讀(3616) 評論(0)  編輯  收藏 所屬分類: 個人日記
    主站蜘蛛池模板: 免费在线观看黄色毛片| 色吊丝永久在线观看最新免费| 亚洲人成图片小说网站| 成年大片免费高清在线看黄| 国产伦精品一区二区三区免费下载| 亚洲日韩AV无码一区二区三区人| 暖暖免费高清日本一区二区三区| 亚洲乱码无人区卡1卡2卡3| 成人免费视频国产| 污污免费在线观看| 亚洲日韩精品射精日| 一级毛片免费毛片一级毛片免费| 99亚洲精品高清一二区| 无码人妻一区二区三区免费手机| 亚洲欧美日韩久久精品| 亚洲第一永久AV网站久久精品男人的天堂AV| 国产精品亚洲一区二区三区在线观看 | 久久国产乱子伦精品免费一| 亚洲无线一二三四区| 国产美女无遮挡免费视频| 一级毛片免费全部播放| 亚洲av鲁丝一区二区三区| 日本免费人成在线网站| 久久精品国产亚洲av品善| 国产av无码专区亚洲av果冻传媒 | 国产91色综合久久免费分享| 亚洲AV无码精品国产成人| 亚洲人成无码网站| av无码久久久久不卡免费网站| 亚洲va中文字幕| 亚洲精品国产字幕久久不卡 | 免费很黄无遮挡的视频毛片| 亚洲AV无码一区东京热| 免费无码精品黄AV电影| 五月天婷婷免费视频| 亚洲国产福利精品一区二区| 亚洲一级特黄大片无码毛片 | 一个人看的hd免费视频| 亚洲精品不卡视频| 亚洲av麻豆aⅴ无码电影| 三年片在线观看免费大全电影|