Title: http keeps reverting to https
Last modified: September 17, 2018

---

# http keeps reverting to https

 *  Resolved [jason kickmouth](https://wordpress.org/support/users/jason-kickmouth/)
 * (@jason-kickmouth)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/)
 * Hi Leon
    In generating my static site I have this as my base url: [http://kickmouth.com/vgilee/](http://kickmouth.com/vgilee/)
   but when I navigate to that it always looks for [https://kickmouth.com/vgilee/](https://kickmouth.com/vgilee/)
   Obviously then the browser cannot connect. How can I force the http version to
   load? Thanks j
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhttp-keeps-reverting-to-https%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Leon Stafford](https://wordpress.org/support/users/leonstafford/)
 * (@leonstafford)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10695900)
 * Hi Jason,
 * That is a bit odd.
 * I just ran the following to download the source from that URL
 * `wget http://kickmouth.com/vgilee/`
 * And there is nothing that I can see there doing it.
 * Unless there is something in the JavaScript redirecting… ah yes, there it is:
 * line 31:
 * `<script>if (document.location.protocol != "https:") {document.location = document.
   URL.replace(/^http:/i, "https:");}</script><script type='text/javascript' src
   ='http://kickmouth.com/vgilee/inc/js/jquery/jquery.js'></script>`
 * That’s not coming from the plugin, so it may be part of the theme or another 
   plugin?
 *  Plugin Author [Leon Stafford](https://wordpress.org/support/users/leonstafford/)
 * (@leonstafford)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10695912)
 * Now, for some reason, I can’t see that in your main site’s source, only in the
   static folder’s version.
 * If you re-run the static export, I would imagine it goes away, as it should represent
   what you have on your live site at the time of exporting..
 * Else, please let me know if it persists, it’s an interesting issue, though very
   unlikely to be caused by the plugin…
 *  Thread Starter [jason kickmouth](https://wordpress.org/support/users/jason-kickmouth/)
 * (@jason-kickmouth)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10696788)
 * Hi Leon – firstly – your support standards are impeccable… excellent work!
    So
   snap, I found that also – I’m guessing it’s coming from a plugin called Really
   Simple SSL. Essentially I was trying to upload the generated site to an HTTP 
   test server – but given the redirect issue, I just deployed to a folder on the
   original HTTPS server which worked absolutely fine. The one issue I am having
   however is that not all of my content is being generated; only about 20 of my
   150 custom posts – can’t figure out why…?!? cheers j
 *  Plugin Author [Leon Stafford](https://wordpress.org/support/users/leonstafford/)
 * (@leonstafford)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10697405)
 * Hi Jason,
 * Great to hear that bit’s sorted.
 * Re the custom posts, this is an issue recently brought to my attention and something
   that I have some ideas to automatically resolve in an upcoming release.
 * Basically, the plugin uses 2 methods for crawling the site – a pre-generated 
   list of posts, pages and anything from your uploads and theme directories; and
   by discovering new links as it crawls the pages.
 * With this in mind, there are two techniques that may solve these missing files
   in the meantime:
 * 1. linking to them from other pages that are crawled (can be links hidden by 
   CSS, may also help search engines index these pages)
 * 2. Adding the URLs to the Additional Urls field under Advanced Settings. If they
   link to each other, one may be enough.
 * 3. Bonus option: the bit in the plugin code that filters post types to seed its
   crawl list with: If we can add your custom post type there, that is hacky but
   should work well. I’ll see if I can find that on my phone…
 * Cheers,
 * Leon
 *  Plugin Author [Leon Stafford](https://wordpress.org/support/users/leonstafford/)
 * (@leonstafford)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10697413)
 * Around here in the library/StaticHTMLOutput/FileHelper.php file:
 *     ```
       public function getAllWPPostURLs(){
               global $wpdb;
       		// TODO: is this the most optimum call?
               $posts = $wpdb->get_results("
                   SELECT ID,post_type,post_title
                   FROM {$wpdb->posts}
                   WHERE post_status = 'publish' AND post_type NOT IN ('revision','nav_menu_item')
               ");
               $postURLs = array();
               foreach($posts as $post) {
                   switch ($post->post_type) {
                       case 'page':
                           $permalink = get_page_link($post->ID);
                           break;
                       case 'post':
                           $permalink = get_permalink($post->ID);
                           break;
                       case 'attachment':
                           $permalink = get_attachment_link($post->ID);
                           break;
                   }
       ```
   
 *  Plugin Author [Leon Stafford](https://wordpress.org/support/users/leonstafford/)
 * (@leonstafford)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10697418)
 * If you can copy the “case ‘post’” section and duplicate with your post type there.
 * This is assuming that’s how your custom post type is stored in the database.
 * Happy to help more from my laptop later if these don’t get you able to export
   for now
 *  Thread Starter [jason kickmouth](https://wordpress.org/support/users/jason-kickmouth/)
 * (@jason-kickmouth)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10701259)
 * Phewww… that was an effort!
    Thanks for the tips Leon and here’s what I tried:
   On my local site I changed the ‘case post’ to my custom post “photoshoots” but
   that failed to generate any more – so I added one or 2 missing URLs in the “Additional”
   section which produced a handful more; but nothing like the complete number. 
   So in the end what I did manually was just add all the missing custom posts as
   Additional urls and did the generation from my live site… It stalled once or 
   twice but it got there in the end and all my custom posts were created. Unbeknown
   to me however was some other content that escaped the crawl – a good dozen or
   so of my lesser used tags failed to materialise so I had to deal with those manually
   also; mostly I just cut them to avoid any 404 errors. Anyway – I’m going to try
   again on another, much smaller and less complicated site and so will report back.
   Thanks for all your help. j

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

The topic ‘http keeps reverting to https’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/static-html-output-plugin_cce3eb.
   svg)
 * [WP2Static](https://wordpress.org/plugins/static-html-output-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/static-html-output-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/static-html-output-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/static-html-output-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/static-html-output-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/static-html-output-plugin/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [jason kickmouth](https://wordpress.org/support/users/jason-kickmouth/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/http-keeps-reverting-to-https/#post-10701259)
 * Status: resolved