redirect from http to https

Issues related to previewing and publishing your web site.
Post Reply
Posts: 1
Joined: Wed Apr 01, 2015 6:59 am

redirect from http to https

Post by swsconsulenze » Thu May 23, 2019 2:31 pm

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

User avatar
Posts: 111
Joined: Sun Dec 30, 2007 2:43 am
Location: Florida, USA

Re: redirect from http to https

Post by gofrank » Thu May 23, 2019 3:31 pm

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 ^(.*)$$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.
Billing clients for your freelance work? Try Minute-2-Minute, the project management, timing, and billing system. Perfect for web developers who charge by the hour. FREE 45-day trial.

Post Reply