How to redirect site from http to https?

Started by swatijain22, May 14, 2019, 07:17:58 AM

swatijain22

Hello friends,


I Have face A problem In My Website,Please tell me, How to redirect site from http to https?

goyums

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]

HostechSupport


goyums

 DO REPLACE EXAMPLE.COM WITH YOUR OWN SITE NAME
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]

More About Our Webmaster Tools for Windows and Mac

HTML, image, video and hreflang XML sitemap generatorA1 Sitemap Generator
      
website analysis spider tool for technical SEOA1 Website Analyzer
      
SEO tools for managing keywords and keyword listsA1 Keyword Research
      
complete website copier toolA1 Website Download
      
create custom website search enginesA1 Website Search Engine
      
scrape data into CSV, SQL and databasesA1 Website Scraper