I have a wordpress site
i would like to change only the admin area to https.
i try to add define(‘FORCE_SSL_ADMIN’, true); in wp-config.php but it is changing the site and the admin area is changing to https
any ideas?
2 comments
Comments are closed.
That constant is used to transfer the connection to HTTPS when entering
wp-admin
, but it is not used to transfer the connection to plain HTTP when leavingwp-admin
. The problem here is that you leave HTTPSwp-admin
and end up on HTTPS frontend.You can use server rewrite directives or PHP
header
redirects to switch the protocol. Example (not tested) for Apache rewrite:Example (not tested) for using
wp_redirect
:you can do it by modifying .htaccess file
Add this code in top of htaccess file
Hope this will work for you.