- Mark Chang
- 0°C
- 5 年又 7 天
Ubuntu環境下apache 目錄啟動.htaccess 功能
.htaccess 檔案是目錄層面的設定檔,可以對目錄變更 Apache 的設定。要使用 .htaccess 檔案,需要在 Apache 的設定檔 (httpd.conf 或 apache2.conf) 開啟使用,否則 Apache 是不會處理 .htaccess 的設定的。
Ubuntu 環境下路徑需編輯 /etc/apache2/apache2.conf
$ sudo vi /etc/apache2/apache2.conf找到以下字串
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>將
AllowOverride None更改為
AllowOverride All後儲存,重啟Apache讓設定檔生效
sudo service apache2 restart
以上紀錄~
https://innstory.com/story-Ubuntu環境下apache目錄啟動htaccess功能-2536
- 2,371
- 0
- 0

