How to force browsers to use http instead of https

hello I had an old site - https://brnsermons.com that had and SSL cert installed on it.

I just rebuilt the site without the SSL because I don't need it - http://www.brnsermons.com

I have deleted the SSL and the site is pointing to a new IP on a different server.

I am getting people telling me that they are getting the following security alert:

-----

Your connection is not secure

The owner of http://www.brnsermons.com has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.

This site uses HTTP Strict Transport Security (HSTS) to specify that Firefox only connect to it securely. As a result, it is not possible to add an exception for this certificate.

Learn more…

Report errors like this to help Mozilla identify misconfigured sites

-------

Any ideas of how i can fix this? It seems to be happening to people who have visited the site in the past. Also google still has the site listed as https://brnsermons.com

Thanks for your help!!!
Cody

  • Adam Czajczyk

    Hello Cody,

    I hope you're well today and thank you for your question!

    I just checked your site and can see that it's fully available over the "http://" connection so I think the issue is that people are visiting it from Google (or from other links distributed across the web) that point to the "https://" version.

    Therefore forcing "http://" would indeed be an option here. An additional benefit of such a solution would be that if you used a "301" redirect ("Moved Permanently") Google would eventually re-index the site and include proper (non-https) links. This code should help here

    add_action( 'template_redirect', 'bhww_ssl_template_redirect', 1 );
    
    	function bhww_ssl_template_redirect() {
    
    		if ( is_ssl() && ! is_admin() ) {
    
    			if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
    
    				wp_redirect( preg_replace( '|^https://|', 'http://', $_SERVER['REQUEST_URI'] ), 301 );
    				exit();
    
    			} else {
    
    				wp_redirect( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301 );
    				exit();
    
    			}
    
    		}
    
    	}

    To apply it to your site add it to the "functions.php" file of your current theme.

    Let me know if it helped, please!

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.