簡體   English   中英

mod_headers 不起作用

[英]mod_headers not working

我在 http.config 中啟用mod_headersmod_rewrite ,從行中刪除 #。

LoadModule headers_module modules/mod_headers.so

LoadModule rewrite_module modules/mod_rewrite.so

我需要啟用更多東西還是錯誤在 .htaccess 上?

.htaccess。

RewriteEngine On
RewriteRule ^(.*?)\.x$ /$1.php [L]
<IfModule mod_headers.c>   
   <filesMatch "\.(x)$">
        Header set foo "baa"
  </filesMatch>  
</IfModule> 

提前致謝!

嘗試加載 headers 模塊

sudo a2enmod headers 
sudo service apache2 restart

我通過清除瀏覽器緩存解決了這個問題。 如果您正在查看 chrome 的瀏覽器檢查器,請檢查“網絡”選項卡中的“禁用緩存”。 但首先要確保 mod_headers 已經安裝並正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM