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

JavaScript 搜尋字串並取代

JavaScript 搜尋字...

在 JavaScript 做搜尋並取代字串可以使用 replace() replace() 適用於在...

使用PHP取得目前網址方式

使用PHP取得目前網址方式

pexelsphoto55 使用PHP取得網址相關的方式有下列幾種: $SERVER["R...

js判斷字母是否為大小寫

js判斷字母是否為大小寫

使用JS來判斷字串裡是否含有大寫字母或小寫字母。 //判斷是否含有大寫字母 function chk...

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