Chuyển đến nội dung
Skillpedia
Bảo mật75k · #2876

http-to-https

Skill này làm gì

Skill này kiểm tra xem máy chủ web có đưa lượt truy cập HTTP thường sang địa chỉ HTTPS an toàn hay không. Skill dành cho chủ trang web và lập trình viên vận hành website.

Khi nào nên dùng

  • ✓Khi khách truy cập gõ tên miền của bạn mà không có https và vào phiên bản không an toàn.
  • ✓Khi các liên kết cũ vẫn trỏ tới địa chỉ http thường.
  • ✓Khi bạn thiết lập máy chủ hoặc nhà cung cấp lưu trữ mới.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/http-to-https/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/http-to-https/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bạn có thể đảm bảo trang web của tôi chuyển mọi truy cập http sang https không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra xem địa chỉ HTTP thường có trả về chuyển hướng 301 tới địa chỉ HTTPS tương ứng và giữ nguyên toàn bộ đường dẫn hay không. Agent gợi ý cấu hình ở cấp máy chủ hoặc CDN, và kiểm tra bằng một yêu cầu CLI.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Redirect HTTP to HTTPS

Without an HTTP-to-HTTPS redirect, users who type the domain without https:// or follow old links land on the insecure version of the site, exposing session cookies and form data to network attackers.

Quick Reference

  • Redirect http://example.com to https://example.com with HTTP 301 (permanent redirect)
  • Preserve the full path and query string in the redirect: https://$host$request_uri
  • Use 301 (not 302) so browsers and search engines cache the redirect and future requests go directly to HTTPS
  • Configure redirects at the server/CDN level — never rely on client-side JavaScript for security redirects
  • After validating HTTPS works, add HSTS to eliminate future HTTP requests entirely

Check

Test whether http://example.com redirects to https://example.com with a 301 status code. Check that the full URL path and query string are preserved in the redirect Location header.

Fix

Configure the web server to redirect all HTTP requests to HTTPS with a 301 status code, preserving the full request path. Verify the redirect with curl -I http://example.com.

Explain

Explain why redirecting HTTP to HTTPS is necessary, the difference between 301 and 302 redirects, and how HSTS can eliminate the redirect for returning users.

Code Review

Review server config, headers, forms, and integration points related to Redirect HTTP to HTTPS. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/http-to-https

Câu hỏi thường gặp

Vì sao dùng 301 chứ không phải 302?

Skill nói 301 là chuyển hướng vĩnh viễn, nên trình duyệt và công cụ tìm kiếm lưu lại và đi thẳng tới HTTPS trong các lần sau.

Có nên làm chuyển hướng bằng JavaScript không?

Không. Skill nói chuyển hướng bảo mật phải được cấu hình ở máy chủ hoặc CDN, không phải trong mã phía máy khách.

Sau khi thiết lập chuyển hướng thì làm gì tiếp?

Skill gợi ý thêm HSTS để chặn các yêu cầu HTTP thường trong tương lai.

Chi tiết

Mô tả gốc của tác giả

Use when checking whether a web server is configured to redirect all HTTP traffic to HTTPS.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2876
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự