Search code examples
.htaccesssslhttpsionos

Difficulties to get SSL certification in my website


How can I get the green locker sign or "secure connection" in my browser URL address?

  1. Already I have a SSL certification supplied by my hosting (Ionos).

  2. Both my Wordpress address (URL) and site address (URL) starts with "https:/" instead of "http:/"

  3. Also I redirect to the new https:/ URL whole traffic received in http:/ by 301 redirection at .htaccess

  4. More over I have remove Wordpress cache using plugin "WP Super Cache"

What else I need to see the green locker?


Solution

  • You are in the right way:

    1.- You need a SSL certification. Your hosting will supply, usually included in the hosting package.

    2.- Either Wordpress or any other CMS you have to address visitors to the right site, maybe on the beginning you had an URL starting by http:/ so if you want to move to the new secure site you need to address properly to the new https:/.

    3.- If your website is not new and you want to redirect to https:/ any visitor arriving http:/ you can add to your .thaccess file the right code to do:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
    </IfModule>}
    

    4.- Be aware that not only your site address should be move from http:/ to https:/ also whole your own links contained in the site should be move. The aim is: your site is secure if your links are also secure. You can use a more generic code to do it:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    5.- Unfortunately, most probably this will not be enough. Be aware that e.g. all your images addressed to http:/...img now should be address to https:/. So you have to look for (ctrl + f) http:/ in the source code (right mouse click on the page you try to make secure at any browser --> "see source code"). Then edit the html file related to this page and simply substitue every http:/ by the https:/

    6.- Only when you have make secure all links your site will be secure. Be brave and go ahead, succeed is at the end.

    Sources:

    https://www.hostinger.es/tutoriales/como-activar-ssl-y-https-en-wordpress/ https://www.hostinger.es/tutoriales/cache-wordpress#Como-borrar-la-cache-en-WordPress