無責任的爛筆頭

          Concentrate & enjoy!
          posts - 3, comments - 15, trackbacks - 0, articles - 7
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          非法命令RewriteEngine

          Posted on 2010-04-05 19:49 BZ 閱讀(1359) 評論(2)  編輯  收藏 所屬分類: Misc
            在使用Access File時,頁面出現500 Internal Error. 檢視Apache錯誤日志是發現: .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration. 
            Google后才發現, RewriteEngine命令需要rewrite mod的支持。從而, 做如下修復:
            $>cd /etc/apache2/mods-enabled    切換到apache下的mods-enabled目錄
            $>sudo ln -s ../mods-available/rewrite.load rewrite.load   啟用rewrite mod
            $>sudo /etc/init.d/apache2 restart    重啟apache服務器

          注:rewrite.load的內容為: LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so  也就是加載mod_rewrite模塊。

          評論

          # re: 非法命令RewriteEngine  回復  更多評論   

          2010-08-26 13:53 by 王海濤
          我的問題和你的是一模一樣,RewriteEngine和RewriteRule都是非法命令,但是我的系統是XP+Apache+PHP5,我該怎么改啊。?

          # re: 非法命令RewriteEngine[未登錄]  回復  更多評論   

          2010-08-26 16:35 by Brian
          @王海濤
          將Apache安裝目錄下的conf/httpd.conf文件中對mod_rewrite模塊的加載打開
          #LoadModule rewrite_module modules/mod_rewrite.so
          --> 去掉前面的#, 然后重啟
          LoadModule rewrite_module modules/mod_rewrite.so

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 连城县| 盘锦市| 沙雅县| 卢龙县| 冕宁县| 科尔| 南皮县| 承德县| 乃东县| 内黄县| 甘南县| 尉犁县| 平原县| 海安县| 昌吉市| 延津县| 麻栗坡县| 安徽省| 屏东市| 溧阳市| 昌吉市| 永济市| 东安县| 三江| 肇州县| 深圳市| 正宁县| 介休市| 饶河县| 黄石市| 广水市| 陆川县| 察雅县| 双牌县| 昌邑市| 巩义市| 和顺县| 景泰县| 玉林市| 晋江市| 三河市|