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

設定Postfix使用SMTP Server當作relay主機

設定Postfix使用SMT...

在/etc/postfix/main.cf 裡修改relayhost 將#relayhost = [...

Format JavaScript Date to yyyy-mm-dd

Format JavaScr...

timecalendar5 JavaScript將Sun May ,轉換成yyyymmdd func...

文件上傳過程中使用白名單、黑名單、或者MIME做認證

文件上傳過程中使用白名單、黑...

pexelsphotolock5 是不是被資安的問題搞得很煩? 我想,在建置系統的過程中,或多或少都...

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