> ## Content Index
> Fetch the complete content index at: https://www.albert-yu.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# 2020ironman 12th – Modern Web – Day06 – WordPress 上 Cloudfront 的最大貧頸 SSL
- URL: https://www.albert-yu.com/blog/2020ironman-12th-modern-web-day06-wordpress-cloudfront-ssl-bottleneck/
- Published: 2020-09-19T16:00:16.000Z
- Updated: 2026-10-30T03:43:21.000Z
- Author: Albert Yu
- Tags: 2020ironman 12th – Modern Web - PHP on AWS 進化論 - 從單主機一路進化到Serverless，以WordPress與 laravel 為例 (中斷), Ithome鐵人賽

### host與https

其實不只是wordpress，任何的框架都有相同的問題

我們都會在程式碼中判斷URL是否正確

如果不符合就就進行301或302跳轉

但是通常的判斷條件只會有URL而不含http或https判定

而wordpress是屬於兩者都會判斷的一套軟體

這時候程式判斷的處理就格外重要

再導入Cloudftont的時這時候我都會建議一定要fotword Hosts參數以避免問題

同時間原站點也是要上SSL證書以避免轉換上的問題

最好的方式一定是 [https://URL](https://url/?ref=albert-yu.com) 進行訪問 Cloudfront 也適用同一個URL是最不容易出狀況的

但是如果預算不允許就要注意這個問題『如何告知您的web server產生的連結均要變更為https』

如果連結都寫好在資料庫還好改但是如果是程式產生的URL就要注意如果沒有處理好

會發生網站以經是https了但是裡面程式產生的URL都還是http造成無法顯示的狀況

發生這種情境最常出現的狀況就是網站破了

因為http的資源被瀏覽器禁止了

這點是相對不容易克服的

如真的在源站無法放SSL證書再來嘗試下面連結

[How do I redirect HTTP traffic to HTTPS on my Classic Load Balancer in ELB?](https://aws.amazon.com/premiumsupport/knowledge-center/redirect-http-https-elb/?ref=albert-yu.com)

基本上還是建議原站要上證書

麻煩會少很多