How to Redirect http to https | SSL Problem

How to Redirect http to https | SSL Problem

Hello today I will be showing How to Redirect HTTP to https so You have first need to make a .htaccess file so you fast go to file manager then click setting > and mark Show Hidden files because .htaccess file is a hidden file


ok now copy the code and pest .htaccess file and save your .htaccess file


if you need https://  use the code

# SSL Https active Force non-www
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

or if you need https://www.  use the code

# SSL Https Active Force www in a Generic Way
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


Thanks if you feel any problem just comment

Recent Posts

Leave a Reply

Your email address will not be published. Required fields are marked *