讓本地 Apache 伺服器識別並套用目錄層級的 .htaccess 設定檔 (URL 重寫、存取控制、自訂錯誤頁等)。
httpd.conf (位於 Apache安裝目錄\conf\httpd.conf)。<Directory /> 區塊 (根目錄設定),預設內容如下:<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
AllowOverride None 修改為 AllowOverride All:<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
httpd -k restart 或服務管理器重啟)。.htaccess,內容例如:RewriteEngine On
RewriteRule ^test\.html$ index.php [L]
https://localhost/test.html 若正確重寫至 index.php 即表示生效。AllowOverride All 允許 .htaccess 覆蓋所有可覆蓋指令 (AuthConfig、FileInfo、Indexes、Limit、Options 等)。AllowOverrideList 精確控制允許指令集。