1. 啟用apache 的 mod_rewrite 模組
    sudo a2enmod rewrite
  2. 重新啟動apache,重新讀取模組,設定才會生效
    sudo service apache2 restart
  3. 更改目錄設定檔為允許覆寫,如(/etc/apache2/apache2.conf)
    <Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride All
     Require all granted
    </Directory>
  4. 重新啟動apache,重新讀取設定檔,設定才會生效
    sudo service apache2 restart
  5.  完成,可以在目錄下創建.htaccess檔案,覆寫設定

Leave a Reply