Force SSL for entire website
-
I want every page of my website to force https. Currently, my website only goes to https when a link is clicked within the website, but not initially (from an external link or direct address typing).
I’ve tried adding the code listed in the FAQ’s:
function custom_force_ssl( $force_ssl, $post_id = 0, $url = '' ) { if ( $post_id == 5 ) { $force_ssl = true; } return $force_ssl; } add_filter('force_ssl' , 'custom_force_ssl', 10, 3);
But it didn’t seem to change anything.
I’ve tried putting a “/” in the URL filters as suggested and it forces HTTPS, however, it adds “~myname” to the url when typed, breaking the link.
For example, when you type http://www.example.com/webpage, it redirects to https://www.example.com/~myname/webpage. Yet all links within the site still work properly.
I know I’m missing something simple, I just can’t figure it out. Please help!
- The topic ‘Force SSL for entire website’ is closed to new replies.