修改 apache2 下的
\# pico /etc/apache2/mods-available/rewrite.load
搜尋並將以下兩行,如果有# 的話,把前面的注解「#」拿掉
> \#LoadModule rewrite\_module modules/mod\_rewrite.so
> #AddModule mod\_rewrite.c
\# pico /etc/apache2/apache2.conf
加入
```
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]
```
\# pico /etc/apache2/sites-available/default
找到 gallery3 的 虛擬網站設定,在
> <Directory /path/gallery3/>
> .............
> AllowOverride All <---- 改成這樣
> #AllowOverride None <---- 原來的
> </Directory>
再先執行這個指令使系統讓指令啟用
> ```
>
> ```
> a2enmod rewrite
> ```
> ```
再重新啟動 apache2 ```
```
service apache2 restart
```
```