Hello friends,
I Have face A problem In My Website,Please tell me, How to redirect site from http to https?
You can use .htaccess file and place this code snippets into it (with Linux Hosting & Cpanel/DirectAdmin):
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
or using this code (with specify domain name)
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule ^(.*)$ https://ohiwill.com/$1 [R,L]
Agreed with as suggested by @goyums
DO REPLACE EXAMPLE.COM WITH YOUR OWN SITE NAME
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]