Skillpedia
الأمان75k · #2876

http-to-https

ما الذي تفعله

تتحقق هذه المهارة من أن خادم الويب يرسل زيارات HTTP غير المشفّرة إلى عنوان HTTPS الآمن. وهي موجهة لأصحاب المواقع والمطورين الذين يديرون مواقع إلكترونية.

متى تستخدمها

  • ✓عندما يكتب الزوار نطاقك دون https فيصلون إلى النسخة غير الآمنة.
  • ✓عندما لا تزال الروابط القديمة تشير إلى عناوين http غير مشفّرة.
  • ✓عندما تُعدّ خادمًا جديدًا أو مزود استضافة جديدًا.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/http-to-https/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك التأكد من أن موقعي يعيد توجيه كل زيارات http إلى https؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يتحقق الوكيل من أن العنوان غير المشفّر يستجيب بإعادة توجيه 301 إلى عنوان HTTPS المطابق، مع الحفاظ على المسار كاملًا. ويقترح ضبط ذلك على مستوى الخادم أو شبكة CDN، واختباره بطلب من سطر الأوامر.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

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

الأسئلة الشائعة

لماذا 301 وليس 302؟

تقول المهارة إن 301 دائمة، فتخزّنها المتصفحات ومحركات البحث وتذهب مباشرة إلى HTTPS في المرات القادمة.

هل يمكن تنفيذ إعادة التوجيه بـ JavaScript؟

لا. تقول المهارة إن إعادات التوجيه الأمنية يجب ضبطها على الخادم أو شبكة CDN، لا في شيفرة جانب العميل.

ماذا بعد ضبط إعادة التوجيه؟

تقترح المهارة إضافة HSTS لمنع طلبات HTTP غير المشفّرة مستقبلًا.

التفاصيل

الوصف الأصلي من المؤلف

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

repo: thedaviddias/Front-End-Checklist

الشعبية

نجوم GitHub
75k
الترتيب
#2876
الترخيص
MIT
آخر تحديث
31‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة