Loading...

在PHP裡添加HTTP Strict Transport Security

Temperature: 0 °C

Mark ChangMark Chang
author_tools

要通過 PHP 啟用 HTTP 嚴格傳輸安全,請使用以下設定。

<?php
//告訴瀏覽器站點只能通過https加載
header("Strict-Transport-Security:max-age=31536000");
?>

max-age 的設定值以秒為單位。

這裡使用 31536000 為12 個月。

#故事  #php  #HTTP Strict Transport Security  #maxage  
https://innstory.com/story-在PHP裡添加HTTP_Strict_Transport_Security-2761
PHP

Prev
 直接在PHP重新命名帶有前綴的sessionname

Next
41是一個甚麼數字啊 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

當域名 DNS 尚未生效時,如何預先設定及測試網站

當域名 DNS 尚未生效時,...

建置一個新的網站或是將網站搬家時 常常會遇到一個問題,就是要將網址指向到新的網站空間,設定完畢但需要...

如何將 a href 禁用

如何將 a href 禁用

如標題,若採用CSS的方式作法如下: .disabled { pointerevents: none...

設置屬性 PHP PDO setAttribute

設置屬性 PHP PDO s...

PDO::ATTRCASE:強制列名為指定的大小寫。 PDO::CASELOWER:強制列名小寫。 ...

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