Header-Ad

PHP,Joomla,WordPress & Linux based server management, error resolutions and fixing problems.

Sunday, November 13, 2016

WordPress SSL - How To

How to Setup WordPress to Use SSL and HTTPS

If you are starting a new site and/or want to use HTTPS everywhere on your site, then you need to update your site URL.
You can do this by going to Settings » General and updating your WordPress and site URL address fields.

Now if you’re adding SSL to your existing site, then you need to setup WordPress SSL redirect from HTTP to HTTPS.
You can do this by adding the following code in your .htaccess file:
1<IfModule mod_rewrite.c>
2RewriteEngine On
3RewriteCond %{SERVER_PORT} 80
4RewriteRule ^(.*)$ https:
5</IfModule>
Don’t forget to replace yoursite.com with your site URL.
If you are on nginx servers (most users are not), you would add the following to redirect from HTTP to HTTPS:
1server {
2listen 80;
3server_name yoursite.com www.yoursite.com;
4return 301 https:
5}
By following these steps, you will avoid the WordPress HTTPS not working error because all your site URL and content will be on SSL.
If you want to add SSL and HTTPS on your WordPress multi-site admin area or login pages, then you need to configure SSL in wp-config.php file.
Simply add the following code above the “That’s all, stop editing!” line in your wp-config.php file:
1define('FORCE_SSL_ADMIN', true);
This wp-config.php SSL trick works for single sites as well as multi-sites.

Setup SSL and WordPress HTTPS on Exclusive Pages

Now if for some reason, you only want to add HTTPS and SSL on specific pages of your site, then you would need the plugin called WordPress HTTPS (SSL).
First thing you need to do is install and activate the WordPress HTTPS (SSL) plugin.
Please note that this plugin hasn’t been updated for a while, but it works fine and is safe to use. See our guide on installing plugins not tested with your WordPress version for more information.
Upon activation the plugin will add a new menu item labeled HTTPS in your WordPress admin. You can click it to visit the plugin’s settings page.


The first option of the settings page asks you to enter your SSL host. Mostly it is your domain name. However, if you are configuring the site on a subdomain and the SSL certificate you got is for your main domain name, then you will enter the root domain. If your using a shared SSL certificate provided by your web host, then you will need to enter the host information they provided instead of your domain name.
In some cases if you are using a non-traditional SSL host and need to use a different port, then you can add it in the port field.
Force SSL Administration setting forces WordPress to use HTTPs on all admin area pages. You need to check this box to make sure that all traffic to your WordPress admin area is secure.
The next option is to use Force SSL Exclusively. Checking this box will only use SSL on pages where you have checked the Force SSL option. All other traffic will go to the normal HTTP url.
This works if you only want to use SSL on specific pages like shopping cart, checkout, user account pages, etc.
Click on the save changes button to store your plugin settings.
If you want to use HTTPS just for specific pages, then you need to edit those pages and check the Force SSL checkbox.



Once done, visit your page to ensure that you have all green light in Chrome and other browsers.


Good luck!!


No comments:

Post a Comment

** Comments are reviewed, but not delayed posted **