https://help.superhosting.bg/en/http-to-https-secure-connection.html
  • bg
  • en

Hosting, Domains, Cloud, Virtual Private Servers (VPS), Managed VPS, SSL Certificates

Redirect Using .htaccess - Your Website Starts Loading via Secure HTTPS Connection

Control Panel cPanel
SSL, secure connection, https

To use a secure connection between the user and a website you first need to issue and install an SSL certificate in your hosting account.

You can select and purchase an SSL certificate from SuperHosting.BG.

After the SSL certificate has been issued and installed into your hosting account,, you can activate a secure connection for your website.

info-iconNote: Some types of CMS require that you set up the SSL connection through the website administration.

To enable secure connection you can redirect it by using the .htaccess file, located into the website directory.

info-iconImportant: If you already have an .htaccess file, containing rules, we recommend making backup before changing anything. You can quickly back up a single file by generating a copy of it.

Redirecting through a secure connection for new websites:

SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "mysite.com"
ErrorDocument 403 https://mysite.com

This type of redirect is suitable for fresh WordPress installations if there aren't any pages indexed on the web.
Redirect for already existing pages from the website:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mysupersite.com/$1 [R=301,L]

или

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R=301,L]

This type of redirect will also catch queries with no specified URLs from the website, for example if a user is trying to access a page:

http://mysupersite.com/?p=1

will be redirected to:

https://mysupersite.com/?p=1

info-iconImportant: After you modify the .htaccess file, carefully scrutinize if everything on the website is properly working. Check if all links, menus, pages and resources are loading correctly via https://.

After modifying the .htaccess file, you might need to clear your browser's cache in order to view the changes.

500px270px
SuperHosting.BG

Comments

Be the First to Comment!

Notify of
avatar
wpDiscuz
All rights reserved © 2005-2017 , www.superhosting.bg