WebLeaps

570.629.6980

facebook twitter


Updating Non-SSL Links to SSL Links in phpMyAdmin

Thursday, May 31st, 2018

Forcing your website to use https:// instead of http:// has plenty of advantages, but there’s also quite a few steps that need to be taken to get that “green lock” on each page.

  1. INSTALL CERTIFICATE – Have an SSL Certificate Installed (it will need to be renewed yearly)
  2. Update .htaccess file – Have your .htaccess file updated to properly redirect all old links to new links to avoid drops in Search Engine rankings
  3. Update URLs and Images – Update all file links and image links to run securely through the certificate  i.e. https://www.yourwebsite.com/img/secureimage.gif

If you have URLS hardcoded in your database this can add on an additional tricky factor.  Especially if it’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.

UPDATE `TABLENAME` SET `COLUMNNAME` = REPLACE(
`TABLENAME`.`COLUMNNAME`,
“http://”,
“https://”
)

Editing your .htaccess file seems pretty easy, and it is…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!

.htaccess PERMANENT 301 REDIRECT  (add to existing .htaccess file).  DO NOT USE unless you are 100% confident that you know what you’re doing! 🙂

RewriteCond %{HTTP_HOST} yourwebsite\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://yourwebsite.com/$1 [L,R=301]

Leave a Reply

facebook

570.629.6980