Webmaster Forums - Website and SEO Help

Web Development and Design => Database, Server, Coding and Website Administration => Topic started by: swatijain22 on May 14, 2019, 07:17:58 AM

Title: How to redirect site from http to https?
Post by: swatijain22 on May 14, 2019, 07:17:58 AM
Hello friends,


I Have face A problem In My Website,Please tell me, How to redirect site from http to https?
Title: Re: How to redirect site from http to https?
Post by: goyums on May 16, 2019, 07:42:31 AM
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]
Title: Re: How to redirect site from http to https?
Post by: HostechSupport on July 18, 2019, 03:57:30 AM
Agreed with as suggested by @goyums
Title: Re: How to redirect site from http to https?
Post by: goyums on September 05, 2019, 05:20:22 AM
 DO REPLACE EXAMPLE.COM WITH YOUR OWN SITE NAME
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Title: Re: How to redirect site from http to https?
Post by: Betasolutionscpa on May 26, 2025, 05:19:55 AM
Redirecting your website from HTTP to HTTPS is crucial for security and user trust. It ensures that all information sent between your server and the browsers of your visitors is encrypted. Your web server software determines the approach you choose.

Before you start:

Apache (.htaccess file)
This is the most common method for shared hosting environments.