0

I bought an SSL certificate for a website and followed the full installation procedure given by the vendor. It is now active and if I go to lets say https://website.com I get the desired result.

However, when someone tries http://website.com the request is not redirecting to https://website.com. I want that when someone enters website.com the request is automatically redirected to https://www.website.com.

I am using GoDaddy Linux server hosting. Please suggest what should I do to achieve what I want.

1 Answers1

1

This is also including SEO 301 redirections. Tested and works fine:

Options +FollowSymlinks
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://www.site.co.uk/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^site.co.uk [NC]
RewriteRule ^(.*)$ https://www.site.co.uk/$1 [L,R=301]
Dom
  • 117
  • 1
  • 4
  • last 2 lines is to redirect https://site.co.uk to https://www.site.co.uk. It is sometimes needed for SEO. – Dom Apr 14 '13 at 00:08