//開啟 .htaccess 功能
//1.安裝 mod_rewrite 模組
sudo a2enmod rewrite
//2.在 /etc/apache2/apache2.conf 加入
sudo vim /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
//重開apache
sudo service apache2 restart