Page 1 of 1

redirect from http to https

Posted: Thu May 23, 2019 2:31 pm
by swsconsulenze
Hi, in accordance to the GOOGLE rules, I need to redirect all pages of my website from HTTP to HTTPS. My provider define available the SSL certficate. the question is: how is possible to redirect all pages to HTTPS. thanks

Mario Moro

Re: redirect from http to https

Posted: Thu May 23, 2019 3:31 pm
by gofrank
Assuming your site is running an Apache server, you will need to create an .htaccess file with the following contents (modified with your domain name):

Code: Select all

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [L,R=301]
Upload the file (and the name must be .htaccess) to your public_html directory. Refresh your browser and you should see the results.