Make website always go to HTTPS

Hi there!

I need to make it so every link on my site or people coming to my site ALWAYS go to the https version of the site.. I've heard this should be done server side or by php, can you help me?

    Sohag

    Hi Gwen,

    Hope you are doing well today!

    Thanks for the support access. It seems you already have SSL certificate for your site.

    You can force both logins and access to the WordPress admin area to use SSL. Before that please have a backup of your entire site this will prevent you from losing everything if something goes wrong. Once that’s done you can continue. To set up SSL first edit your wp-config.php file and add the following line of code.

    define('FORCE_SSL_ADMIN', true);

    Just make sure you place the code above the line that says

    /* That's all, stop editing! Happy blogging. */

    After that you need to set a 301 redirect so that anyone visiting your site will be automatically redirected to your site using https instead of http.

    Find and edit your .htaccess file if there is no .htaccess file in you wordpress sites root then create a new one. If it already exists place the following code above everything that’s already there.

    Please replace “yoursite.com” with your domain and enter in the correct server port if yours isn’t 80.

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

    For more information on using SSL and HTTPS with WordPress please visit our blog

    https://premium.wpmudev.org/blog/ssl-https-wordpress/

    Hope this helps.

    Please let us know if you need any further help.

    Cheers,
    Sohag