Latest News

Custom Domains And HTTPS Redirection Code

As most of us know, Blogger HTTPS support does not include custom domain publishing.

The advantages offered by HTTPS access are widely advertised - and have led to envy between blog owners who publish to custom domains, and native BlogSpot blog owners proudly advertising their new HTTPS connectivity.

Long ago, we saw possibly malicious code which helps our readers avoid using country code aliases, to read our blogs from an aliased country. Recently, there was dodgy code which blocked HTTPS mode, to read a customised blog.

Now, we have custom code to force HTTPS access, for BlogSpot published blogs.

Along with providing code to help blog owners avoid country local domain aliasing, some marginally helpful hackers are providing code to help blog owners force reader access to HTTPS.

Some blog owners always wanted HTTPS to be used, to access their blog.

Some blog owners wanted their readers always using HTTPS to access their blogs, before forced HTTPS access became an option. They Googled, and found, semi helpful hackers who provide clever code to force the "HTTP --> HTTPS" redirection.

<script type='text/javascript'>
$(document).ready(function() {
  $("a[href^='http://']").each(
    function(){
      if(this.href.indexOf(location.hostname) == -1) {
        $(this).attr('target', '_blank');
      }
    }
  );
  $("a[href^='https://']").each
    function(){
      if(this.href.indexOf(location.hostname) == -1) {
        $(this).attr('target', '_blank');
      }
    }
  );
});
</script>


This is clever code - when only BlogSpot access is involved. When you add BlogSpot to custom domain redirection, it becomes another "404".



Adding this clever code is an excellent solution - until the blog owner forgets about it, and later upgrades to a non BlogSpot custom domain.

With a custom domain published blog, the redirection becomes a problem.

The added code contains no exception to permit custom domain published blogs to remain in HTTP mode. When accessing an otherwise properly setup custom domain published blog, from a reader using the "blogspot.com" URL, this prevents the BlogSpot to domain redirect from operating.

BlogSpot URLs, which should redirect to the HTTP published custom domain URL, instead redirect to a non existent HTTPS URL - and result in another "404". As the custom domain URL becomes more commonly used for a recently published blog, confusion increases when the rarer BlogSpot URL reference is encountered.

My blog has been using the domain URL for months, why is this happening now?

The problem involves dual redirection - to "https:" mode, and to the custom domain.

After painful problem diagnosis, we find the clever redirection code buried in template HTML - and we see that the blog reader is starting from the BlogSpot URL, and using the BlogSpot to domain redirection, to access the blog.

With blog access redirected to "https:" mode, then subsequently to the custom domain URL, the readers sees a "404" - because the custom domain URL is not available as "https:" content.

This problem will become increasingly rarer - but not extinct.

As self caused custom domain victims become rarer, this way of breaking ones own blog will become more obscure - and it's likely that some cases will go, unsolved. This will be similar to the problem of un migrated classic templates, which has increasingly less experienced support.

If you must install unsupported template tweaks into your template - consider the long term effects. Learn to recognise a problem that you have caused, to your own blog.

Not every helper will realise that you have added custom redirection code - and when looking at the problem code, when a problem is reported, will recognise it for what it is. Your problem may remain your problem - at least, until Blogger Engineering completes Blogger SSL integration (may this happen soon).



Some blog owners have added clever HTTP to HTTPS redirection code, acquired from helpful third party providers, installed in the template. When later publishing a blog to a custom domain, this code will prevent proper blog access - and as installed, may not be easily recognised.

https://productforums.google.com/forum/#!category-topic/blogger/bl5W39BKX4U

Revert A Page / Post To Draft Status

Sometimes, we need to remove a page or post from a blog - but prefer to not delete it.

There are various reasons for not wanting to delete a page / post immediately or permanently - maybe when removing a post for problem diagnosis, or to change the URL to match the publish date. Reverting to draft status is easily reversed, and has no permanent side effects.

When you want to quickly - but not permanently - remove a page or post, you can revert to draft status.

Reverting to draft status is convenient, safe, and simple.

You can revert a page or post using Page / Post Editor, or the Pages / Posts dashboard page.

  • Revert, using the Pages / Posts dashboard pages.
  • Revert, using the Page Editor / Post Editor.

Revert, using the Pages / Posts dashboard pages.

The Pages / Posts dashboard page is a menu. Simply select one or more pages or posts, then click "Revert to draft". Click on "Yes" to verify. and you're done.


Hit "Revert to draft", after selecting a page or post.



Revert, using the Page Editor / Post Editor.

Any time that you are editing a previously published page or post, click "Revert to draft". And you're done.


Hit "Revert to draft", when in page / post editor.



And when you're done, you're done.

Once a post is newly draft, it's offline. Page / post content in cache on your readers's computers will be readable until it expires. New readers, on the other hand, will see a "404" immediately.

You can recover the post with the URL - or rename to a new URL.

If you revert to draft - then later, re publish without changing the title, you will get the same post, with the same URL, back. If you change the title with the post in draft status, you get the same post content, under a new URL, when you re publish.

If you do the latter by mistake - then discover the mistake later, you can recover the mistake by merging the new and previous URLs. Just add a custom redirect from the new to old URL (or vice versa).

Review / Recover The Draft Inventory, With One Mouse Click

Any time that you need, review the inventory of Draft posts. Just click on "Draft" under "Posts". You can Edit then Publish - or just Publish, immediately.


Check out the current Draft posts complement, from Pages or Posts - Draft. Then recover one or more.

Just select one or more posts, then "Publish".




Or edit a page or post, then Publish.



Either way, you can recover any pages or posts, reverted, easily enough - as long as you revert them, instead of deleting them.

Just understand the possibilities.



Reverting a #Blogger blog post to draft status is a quick, yet reversible, way to take a post offline. The URL will be recovered, automatically - as long as you do not change the title.

Blogger Magic - Move Content Between Blogs

Some blog owners, who publish multiple blogs with different subjects, may decide that some subjects would be better discussed in a different blog.

With various posts published in one blog, the owner may decide that those posts should be published in a different blog, to continue discussion. The question now is how to move posts, from one blog to another?

The dashboard "Export / Import" feature, which is now labeled "Import & back up", lets us copy pages and posts from one blog to another. Just copying all pages and posts, though, will create problems with duplicated content.

If you are going to move specific posts from one blog to another - and continue to publish both blogs - you have to add extra steps to the process.


Use "Import & back up", on the Settings - Other dashboard page.



  1. Export all content from the first blog.
  2. Import all exported content, to the second blog, as "Imported".
  3. Publish imported content, selectively, in the second blog.
  4. Delete content re published, from the first blog.
  5. Setup custom 404 or custom redirects, from the first blog.
  6. Remove imported yet un published content, from the second blog.

Export all content from the first blog.

Using the "Import & back up" wizard, on the dashboard Settings - Other page for the first blog, click "Back up Content". This will export all pages and posts, in the blog, to the file which you select.

To make it easier, label the posts that you want to "move" to the other blog, before you start "Back up Content".


I labeled my posts "Move".




Now, "Back up Content", from the first blog.




Use the file manager provided by your operating system, to create or select a file / folder, and actually save the file.



Import all exported content, to the second blog, as "Imported".

Using the "Import & back up" wizard, on the dashboard Settings - Other page for the second blog, click "Import Content" - then find and select the file just created. This will import all pages and posts, as exported from the first blog - and place the imported pages and posts in the special "Imported" status, on the Pages and the Posts dashboard pages.


Continue with "Import Content", to the second blog.




Select the file that you just created, above.




And having Imported everything, there are the posts - including those labeled "Move".



Publish imported content, selectively, in the second blog.

Using the "Pages" and "Posts" dashboard pages, select the newly activated "Imported" menu, as you wish. This will list all imported pages and posts, in turn.

Find the pages and posts that you want moved, select them, and click "Publish". If you labeled the posts to be "moved", simply display, and Publish, all posts with the designated label.


And, I Published the posts labeled to be "moved".



Note that, once Published, the "Imported" status is cleared.

Delete or revert content re published, from the first blog.

To prevent problems with search engines detecting duplicate content, you can delete or revert to draft status, each post in the first blog, the you just re published in the second blog. If you revert to draft status, you will have backed up content and a recoverable page / post URL.

Again, if you labeled the posts, you can delete or revert posts using the label.

Setup custom 404 or custom redirects, from the first blog.

You cannot use a custom redirect to automatically redirect from the first blog to the second. You can, however, setup a custom 404 page, in the first blog - or make custom redirects to a custom 404 page, in the first blog - advising the reader that the post just requested is now part of the second blog.

The reader will still have to intentionally click to jump into the second blog - but until Blogger blogs are not used as spam hosts, this will be necessary to avoid making your blog look like a spam host.

And as noted, please don't use this technique to re use a single blog. Duplication prevention will generate suffixed URLs, for pages and posts exported then imported to the same blog.

Remove imported yet un published content, from the second blog.

As a type of basic hygiene, once all of the posts are moved ("published"), remove all imported content that isn't published. If you ever repeat the exercise, you won't enjoy the duplicated content, that you will have to identify, from having Exported then Imported, twice.


The "Import & back up" #Blogger dashboard wizard can be used to copy pages and posts, from one blog to another. Actually moving content requires more than just exporting from one blog, and importing to a second blog.



http://blogging.nitecruzr.net/2016/06/blogger-magic-export-from-blogger-blog.html

https://productforums.google.com/forum/#!category-topic/blogger/hJ-WrGwnIFo

Contact Us

24x7 online , we happy to answer you
tamilcypc@gmail.com

Disclaimer

This Blog and its TUT's are intended for educational purposes only, no-one involved in the creation of this TuT may be held responsible for any illegal acts brought about by this Blog or TuT.



Featured Post

Custom Domains And HTTPS Redirection Code