how to force redirect to https

praveen545445

Senior Member
Joined
Dec 6, 2017
Messages
866
Reaction score
106
Ok i have installed the certificated in cpanel but the domain is not automatically redirecting to https so i want to know how to do that ?
 
Put this in public_html, .htaccess file


Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
 
you can change your.htaccess file and put https where you see http...

also you can use cloudflare which has option to force https....
 
Put this in public_html, .htaccess file


Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
thanks got it but there is one question my website panel is pointed in subdomain but there is one problem users unable to receive reset password link i tried to ask this question to my web developer he is saying that the reset password link not going to work if your website is in subdomain if you put your website on main domain then only its going to work. so what is the solution for it do you have any idea
 
You don't receive password reset email with instructions?
 
You don't receive password reset email with instructions?
no its because i installed the script in subdomain that's why if it is in public_html then only i receive that. (there is some issue that's why i can't install that in main domain)
 
Actually, I don't understand your website's structure, and what you trying to achieve. Try to explain better.
 
Back
Top