[resolved] Forcing SSL in WordPress 2.6 (4 posts)

  1. kihbord
    Posted 8 years ago #

    I am trying to setup SSL for wordpress 2.6 on my computer. I have installed wordpress, created a self-signed SSL cert, assigned a dedicated IP for the host (a non-routable IP address has been assigned) and modified the wp-config.php file to include the FORCE_SSL_ADMIN constant.

    I tried to access the /wp-admin from a non-secure URL (http://www.example.com/wp-admin) but it's not redirecting to the secure url (https://www.example.com/wp-admin).

    How do I force it to redirect? From what I understand on Ryan's post it's suppose to force SSL admin usage.

    Tried google search and this forum but i wasn't able to find a solution.

    Hope someone could tell me how to do it or point me in the right docs.

  2. Kihbord, the search, it is your friend.

    Copied from an earlier answer:
    Make a backup copy of your wp-config.php (backups are your friend). Now go to http://api.wordpress.org/secret-key/1.1/ and insert that output in your wp-config.php above the line that says "stop editing".

    Right below that, add

    define('FORCE_SSL_ADMIN', true);
    define('FORCE_SSL_LOGIN', true);

    And give it a shot. If all goes well, you'll login via SSL and the admin pages will be mostly SSL based.

    If not, put back that copy of wp-config.php and you should be fine.
    Also on your browser, clear your cache and cookies.

  3. kihbord
    Posted 8 years ago #

    I've found the problem. When I inserted the define statements in my config file, I sort of copied and paste the thing from Ryan's blog and instead of having ' quote in the define statements. The pasted code used a ` quote which caused it not to function properly. (hahahaha!)

    It's now working flawlessly redirecting to https when i try to access the admin via http.


  4. BobMane
    Posted 7 years ago #

    So whats the difference? If I have a dedicated SSL cert and and the code`define('FORCE_SSL_ADMIN', true);
    define('FORCE_SSL_LOGIN', true);` then http.myblog will be https.myblog and....what? now my entire blog including admin and the public site are secure?

Topic Closed

This topic has been closed to new replies.

About this Topic