Redirect URL on site load

Hi Our SSL certificate is only configured for the https://domain name so when a browser enters https://www.domain name it gets a security warning. The certificate vender suggested a redirect would be the easiest solution.
Im hoping blocs can do this, if so how would I do that.


That is more usually done through the hosting facilities configuration, do you have access to cPanel or your vendors equivalent?

Do you mean the domain host or the actual site host?

The actual host where your site sits, you should have access to some form of controls, one of which should be domain forwarding. Unfortunately, they are not all the same so I cannot be specific on what they have made available to you. My provider has given me cPanel and from there I have a lot of configuration option around the hosting etc.

Just create a redirect with a .htaccess file on the server, so that everything automatically redirects to https://. This is something I do on all my sites.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.)
RewriteRule ^.
$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

Possible alternative:

RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$$1 [R,L]

Another alternative:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

1 Like

That’s good a good solution but I ended up adding a redirect at my dns pointer site

A DNS redirect sounds clever. I’ve never tried that.