• Resolved davehep

    (@davehep)


    I’m in the process of adding a SSL to my ecommerce website.

    Rather than use a plugin to do the job for me (I have heard of some horror stories!), I’d like to do everything manually – i.e., change every page from http to https.

    That should be fairly straightforward – if a little time consuming.

    My question concerns the media library where I have many uploaded PDF and image files all linked from pages with absolute paths to them.

    Is there an easy/quick way to change the url where the images and files are stored (wp-content/uploads/2015/06/filename.pdf), or does every single file/image need to have its url changed to https?

    I’ve heard of a way of doing this by adding a redirect to the htaccess file. Is this an acceptable way of doing things, or do some browsers get a bit funny if you use redirects?

    Or maybe someone can recommend a good plugin that will do all of this for me? The only one I’ve looked at so far is WordPress HTTPS.

    Thanks,

    Dave

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have successfully used this (stable version) to change the URL’s in the DB from HTTP to HTTPS multiple times without issue:

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Prior to using this, it is imperative that you create a full DB backup! It is also not done until the site is resolving to HTTPS. You will want anyone with old URL’s to the site to be redirected to the HTTPS URL’s so you will want some rules included in the site root .htaccess files above the WordPress rules:

    # BEGIN SSL
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_USER_AGENT} ^(.+)$
    RewriteCond %{SERVER_NAME} ^yoursite\.com$
    RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
    Header add Strict-Transport-Security "max-age=300"
    </IfModule>
    # END SSL

    You will need to change this line to your domain:

    RewriteCond %{SERVER_NAME} ^yoursite\.com$
    Thread Starter davehep

    (@davehep)

    Wow – what a quick response!!

    Thanks for that – I’ll certainly have a good look at what you recommend.

    Regards,

    Dave

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘HTTP to HTTPS – adding SSL to WordPress Site’ is closed to new replies.