• slider image 168
:::
條列式新聞
新聞載入中,請稍後...

1-1-1 Apache Mod_rewrite

Apache Mod_rewrite 開啟教學

修改 apache2 下的

# pico /etc/apache2/mods-available/rewrite.load
搜尋並將以下兩行,如果有# 的話,把前面的注解「#」拿掉

#LoadModule rewrite_module modules/mod_rewrite.so
#AddModule mod_rewrite.c

 

# pico /etc/apache2/apache2.conf
加入

<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?kohana_uri=$1 [QSA,PT,L]
    RewriteRule ^$ index.php?kohana_uri=$1 [QSA,PT,L]
    RewriteRule ^index.php/(.*) $1 [QSA,R,L]
 </IfModule>

 

# pico /etc/apache2/sites-available/default

找到 gallery3 的 虛擬網站設定,在 

<Directory /path/gallery3/>
       .............
                AllowOverride All   <---- 改成這樣

                #AllowOverride None     <----  原來的 
        </Directory>

 

再先執行這個指令使系統讓指令啟用

a2enmod rewrite
再重新啟動 apache2
service apache2 restart

:::
展開 | 闔起

文章類別

書籍目錄

展開 | 闔起

線上使用者

3人線上 (3人在瀏覽線上書籍)

會員: 0

訪客: 3

更多…