2 Redirects from http:// to https://www

habibhahaha

Registered Member
Joined
Aug 22, 2019
Messages
62
Reaction score
8
Hi guys. I just bought a domain and was setting it up and noticed that from the http://domain.com to the https://www.domain.com version, it goes through 2 redirect jumps.
First redirect is to https://domain.com and the 2nd redirect is to https://www.domain.com.
Is there a way to redirect immediately from http:// to https://www. without going through 2 redirects?


I wasn't sure where to ask this question so if it's in the wrong section I'll remove it.
 
Yes there is an easy way to do it from your dashboard on WP
Just search for Really Simple SSL Plugin here on BHW you can get Pro version Nulled for free
upload it then active it and Voila automatically redirection to HTTPS
OR you can do it from your cPanel for that just type how to redirection from http to https on YouTube.
 
Apache config:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*) https://www.domain.com/$1 [R=301,L]
</IfModule>


Rename domain.com to match your actual domain.
save this as the following file (no name - just extension)
.htaccess

Store the file in your www path.
 
Insert this code into .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=302]
 
Apache config:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*) https://www.domain.com/$1 [R=301,L]
</IfModule>


Rename domain.com to match your actual domain.
save this as the following file (no name - just extension)
.htaccess

Store the file in your www path.
Thank you. This worked perfectly.
 
Back
Top