WordPress और HTTPS usually smoothly काम करते हैं — लेकिन जब नहीं करते, तो errors confusing हो सकती हैं। यह guide हर common WordPress SSL problem और उसे कैसे fix करें को cover करती है।
Initial SSL setup के लिए, हमारी WordPress SSL installation guide देखें।
ERR_TOO_MANY_REDIRECTS (Redirect Loop)
#1 WordPress SSL problem। आपका browser “This page isn’t working — redirected you too many times” दिखाता है।
Reason 1: Proxy के Behind (Cloudflare, Load Balancer)
Proxy SSL terminate करता है और WordPress को HTTP forward करता है। WordPress HTTP देखता है, HTTPS पर redirect करता है। Proxy फिर से HTTP forward करता है। Infinite loop।
Fix — wp-config.php में add करें (/* That's all, stop editing! */ से पहले):
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
अगर Cloudflare use कर रहे हैं: SSL mode को भी “Full” या “Full (Strict)” पर set करें — कभी “Flexible” नहीं।
Reason 2: Conflicting Redirects
आपकी .htaccess HTTPS पर redirect करती है, और एक WordPress plugin (जैसे Really Simple SSL) भी redirect करता है, और आपका server config भी redirect करता है। Triple redirect = loop।
Fix: सिर्फ एक redirect source रखें। Recommended: .htaccess redirect, plugin redirect disable करें।
Reason 3: WordPress URL Mismatch
Settings → General http:// दिखाता है लेकिन आपका server HTTPS force करता है।
Fix — wp-config.php के through update करें:
define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');
Mixed Content Warnings (Padlock Broken/Missing)
HTTPS काम कर रहा है लेकिन padlock icon warning दिखाता है, या कुछ resources load नहीं हो रहे।
Reason: आपके pages http:// URLs के साथ images, scripts, या CSS reference करते हैं — usually migration से पहले database में stored।
Quick Fix: Really Simple SSL Plugin
Really Simple SSL install और activate करें — यह dynamically http:// URLs rewrite करता है और upgrade-insecure-requests CSP header add करता है।
Permanent Fix: Database Search-Replace
# WP-CLI (recommended)
wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' --all-tables --precise
# Dry run first to see what changes
wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' --all-tables --dry-run
या GUI approach के लिए Better Search Replace plugin use करें।
यह भी check करें:
- Theme files (
header.php,footer.php) hardcodedhttp://URLs के लिए - Widget content (text widgets, custom HTML)
- Customizer में custom CSS
- Plugin settings (social share images, logo URLs)
HTTPS Enable करने के बाद White Screen / 500 Error
Reason 1: .htaccess Conflict
HTTPS redirect rules WordPress के permalink rules से conflict करते हैं।
Fix: .htaccess reset करें:
# Rename the current one
mv .htaccess .htaccess.backup
# WordPress regenerates it
# Go to Settings → Permalinks → Save (no changes needed)
फिर top पर सिर्फ HTTPS redirect फिर से add करें:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Reason 2: Plugin Conflict
एक security या caching plugin HTTPS change के साथ conflict कर सकता है।
Fix: FTP के through सभी plugins disable करें:
# Rename the plugins directory
mv wp-content/plugins wp-content/plugins.bak
अगर site काम करती है, तो इसे वापस rename करें और conflict find करने के लिए एक-एक करके plugins enable करें।
HTTPS के बाद wp-admin में Login नहीं हो पा रहा
Reason: Cookie Domain Mismatch
http:// के लिए set की गई पुरानी cookies https:// पर काम नहीं करतीं।
Fix:
// Add to wp-config.php
define('FORCE_SSL_ADMIN', true);
define('COOKIE_DOMAIN', 'yourdomain.com');
फिर domain के लिए अपनी browser cookies clear करें, या incognito window में try करें।
SSL Certificate Installed है लेकिन WordPress अभी भी HTTP दिखाता है
Reason: WordPress को HTTPS के बारे में पता नहीं
Certificate server पर है, लेकिन WordPress की URL settings अभी भी http:// कहती हैं।
Fix: दोनों URLs update करें:
- अगर आप wp-admin access कर सकते हैं: Settings → General → दोनों URLs को
https://में change करें - अगर wp-admin access नहीं कर सकते:
wp-config.phpमें add करें:define('WP_HOME', 'https://yourdomain.com'); define('WP_SITEURL', 'https://yourdomain.com'); - अगर wp-config.php काम नहीं करता: Database directly update करें:
UPDATE wp_options SET option_value = 'https://yourdomain.com' WHERE option_name IN ('siteurl', 'home');
Elementor / Page Builder HTTPS पर Broken Layout दिखाता है
Page builders post meta में absolute URLs store करते हैं। HTTPS पर migrate करने के बाद, run करें:
wp search-replace 'http://yourdomain.com' 'https://yourdomain.com' --all-tables
Elementor के लिए specifically, Elementor → Tools → Replace URL पर भी जाएं और http:// से https:// में update करें।
WooCommerce Checkout HTTPS पर काम नहीं कर रहा
Reason 1: Mixed Content Payment Scripts Block कर रहा है
Stripe, PayPal, और other payment gateways को HTTPS required है और mixed content पर load होने से refuse करते हैं।
Fix: Database search-replace (ऊपर) run करें और WooCommerce → Settings → Payments में http:// references check करें।
Reason 2: Force SSL Checkout Setting
WooCommerce में एक “Force secure checkout” option है जो site-wide HTTPS के साथ conflict कर सकता है।
Fix: अगर आपकी पूरी site HTTPS है, तो आपको इस option की need नहीं। WooCommerce → Settings → Advanced → Page setup पर इसे uncheck करें।
FAQ
क्या मुझे Really Simple SSL plugin की need है?
यह HTTP→HTTPS transition को easy बनाता है (especially mixed content), लेकिन यह required नहीं है। अगर आप database search-replace run करते हैं और .htaccess में redirect set करते हैं, तो आपको plugin की need नहीं। Plugin हर page load पर थोड़ा overhead add करता है क्योंकि यह URLs dynamically rewrite करता है।
क्या मुझे certificate install करने से पहले या बाद में WordPress URLs change करने चाहिए?
बाद में। पहले certificate install करें और verify करें कि HTTPS काम करता है। फिर WordPress URLs update करें। अगर आप certificate ready होने से पहले URLs update करते हैं, तो WordPress HTTPS serve करने की try करता है लेकिन नहीं कर पाता — और आप खुद को lock out कर सकते हैं।
मेरा caching plugin पुराना HTTP version serve कर रहा है
Migration के बाद सभी caches clear करें:
- WP Super Cache / W3 Total Cache / LiteSpeed Cache: Plugin settings से cache clear करें
- Cloudflare: Purge Everything
- Server-side (Varnish, Nginx cache): Cache clear करें या service restart करें
मैंने months पहले migrate किया लेकिन Google अभी भी HTTP URLs दिखाता है
Google Search Console में अपना HTTPS sitemap submit करें। Check करें कि सभी pages पर <link rel="canonical"> tags https:// की ओर point करते हैं। Google को re-index करने में weeks लग सकते हैं — 301 redirects help करते हैं लेकिन instant नहीं हैं।