{"id":120,"date":"2018-05-31T18:28:23","date_gmt":"2018-05-31T18:28:23","guid":{"rendered":"http:\/\/www.webleaps.com\/blog\/?p=120"},"modified":"2018-05-31T18:31:59","modified_gmt":"2018-05-31T18:31:59","slug":"updating-non-ssl-links-to-ssl-links-in-phpmyadmin","status":"publish","type":"post","link":"https:\/\/www.webleaps.com\/blog\/code\/updating-non-ssl-links-to-ssl-links-in-phpmyadmin\/","title":{"rendered":"Updating Non-SSL Links to SSL Links in phpMyAdmin"},"content":{"rendered":"<p>Forcing your website to use https:\/\/ instead of http:\/\/ has plenty of advantages, but there&#8217;s also quite a few steps that need to be taken to get that &#8220;green lock&#8221; on each page.<\/p>\n<ol>\n<li><strong>INSTALL CERTIFICATE<\/strong> &#8211; Have an SSL Certificate Installed (it will need to be renewed yearly)<\/li>\n<li><strong>Update .htaccess file<\/strong> &#8211; Have your .htaccess file updated to properly redirect all old links to new links to avoid drops in Search Engine rankings<\/li>\n<li><strong>Update URLs and Images<\/strong> &#8211; Update all file links and image links to run securely through the certificate\u00a0 i.e. https:\/\/www.yourwebsite.com\/img\/secureimage.gif<\/li>\n<\/ol>\n<p>If you have URLS hardcoded in your database this can add on an additional tricky factor.\u00a0 Especially if it&#8217;s hundreds or thousands! So in order to update your links without much hassle a query can be ran via phpMyAdmin to update the links in your database columns that contain non-ssl links to ssl links.<\/p>\n<p><strong>UPDATE `TABLENAME` SET `COLUMNNAME` = REPLACE(<\/strong><br \/>\n<strong> `TABLENAME`.`COLUMNNAME`,<\/strong><br \/>\n<strong> &#8220;http:\/\/&#8221;,<\/strong><br \/>\n<strong> &#8220;https:\/\/&#8221;<\/strong><br \/>\n<strong> )<\/strong><\/p>\n<p>Editing your .htaccess file seems pretty easy, and it is&#8230;BUT if done incorrectly you can cause your entire website to not work AND can damage search engine rankings, so leave it to the professionals!<\/p>\n<p><strong>.htaccess PERMANENT 301 REDIRECT\u00a0 (add to existing .htaccess file).\u00a0 DO NOT USE unless you are 100% confident that you know what you&#8217;re doing! \ud83d\ude42<\/strong><\/p>\n<p><strong>RewriteCond %{HTTP_HOST} yourwebsite\\.com [NC]<\/strong><br \/>\n<strong> RewriteCond %{SERVER_PORT} 80<\/strong><br \/>\n<strong> RewriteRule ^(.*)$ https:\/\/yourwebsite.com\/$1 [L,R=301]<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Forcing your website to use https:\/\/ instead of http:\/\/ has plenty of advantages, but there&#8217;s also quite a few steps that need to be taken to get that &#8220;green lock&#8221; on each page. INSTALL CERTIFICATE &#8211; Have an SSL Certificate Installed (it will need to be renewed yearly) Update .htaccess file &#8211; Have your .htaccess [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":26,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":4,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":124,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/posts\/120\/revisions\/124"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/media\/26"}],"wp:attachment":[{"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webleaps.com\/blog\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}