簡體   English   中英

.htaccess無法解析根文件夾中HTML文件中的PHP

[英].htaccess can't parse PHP in HTML files in the root folder

我正在嘗試解析.HTML文件中的PHP代碼。

我已將以下代碼添加到根文件夾中的.htaccess文件中:

...
    <FilesMatch "\.(htm|html|php)$">
      SetHandler application/x-httpd-php5
    </FilesMatch>
...

進行此更改后,根文件夾之外的所有文件都可以正常工作。

也就是說,這些html文件正確地解析了PHP,沒有任何問題:

  • somedomain / contact / index.html
  • somedomain / about-us / index.html

雖然首頁不是:

  • somedomain / index.html

任何幫助將不勝感激。

謝謝。 V

在開始時添加。*應該可以解決此問題

<FilesMatch ".*\.(htm|html|php)$">
  SetHandler application/x-httpd-php5
</FilesMatch>

暫無
暫無

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

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