Loading...

Ubuntu環境下apache 目錄啟動.htaccess 功能

Temperature: 0 °C

Mark ChangMark Chang
author_tools

.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


Ubuntu環境下apache 目錄啟動.htaccess 功能
以上紀錄~


 

#Ubuntu  #htaccess  #Apache  #httpdconf  #apache2conf  
https://innstory.com/story-Ubuntu環境下apache_目錄啟動htaccess_功能-2536
Linux

Prev
 PHP_運算次方pow_函数

Next
htaccess與RewriteEngine一起使用時500內部服務器錯誤 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

分享 斜槓青年正夯,什麼都會才是王道?他舉賈伯斯、巴菲特為例,勸你萬萬不可跨領域-風傳媒

分享 斜槓青年正夯,什麼都會...

巴菲特:「了解自己的能力圈,待在裡面。這個圈圈到底有多大其實無關緊要。知道圈圈的邊線究竟在哪則非常重...

javascript change css class

javascript cha...

javascript 使用classList是一個方便的替代方法,可以將元素的類列表作為空格分隔的字...

在PHP中如何將NAN轉換為0

在PHP中如何將NAN轉換為...

首先我會得到NAN是因為我有一個計算結果為的值然後我讓他除以,結果就得到了NAN 首先甚麼是NAN?...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format