Baidu Share does not support https. What can we do with localization

2018-8-14 16:19 Originated from this website 8,441 twelve thirteen
[Abstract]

One of the painful problems of Baidu Share is that they do not support HTTPS website calls. At present, it is safer to localize Baidu Share and not call Baidu official files.

The social sharing plug-in is a very practical function for websites. With the closure of JiaThis and other plug-ins, Baidu Share should be the most useful social sharing plug-in. But Baidu Share has a painful problem that they do not support HTTPS website calls~~

百度分享不支持https网站怎么办 本地化轻松解决

We all know that network security is an important topic at present, and hijacking, advertising pop-up and other issues have seriously affected the website user experience for a long time. Many webmasters have timely configured SSL certificates for their sites, officially starting the HTTPS journey. If you used Baidu to share on your website before, it doesn't work.

Yes, Baidu Share's js code does not support HTTPS requests. It is said that Baidu Share has been unable to find a profit point. Fortunately, Baidu officials are too lazy to maintain it and spend money and material resources to configure HTTPS for you? Go to bed

What about our HTTPS enabled websites? At present, the more secure way is to localize Baidu's sharing, not call Baidu's official files. We support HTTPS requests ourselves

Method steps:

1. Download relevant Baidu shared files and unzip them to get the static folder

Click Download Extraction code: pxaa

2. Place the static folder directly into the root directory of the website

3. Put the Baidu sharing code you get into http://bdimg.share.baidu.com/static/api/js/share.js Replace with http://yourdomain.com/static/api/js/share.js that will do

Note: If you don't want to use the static folder name or can't put it in the root directory, you can change it according to your actual situation. However, share.js in the static/api/js/directory must be modified. Otherwise, due to path problems, Baidu sharing will not work properly.

Modification method:

Open the share.js file to search for "static/" and replace the folder path with your folder name. The path must be filled in correctly. In the root directory, directly "static/"; Write "example/static/" in the example folder, such as~~

Localization of Baidu shares has many advantages. First, it solves the problem of HTTPS calls. More importantly, the file request is on the server, completely free from the restrictions of third-party servers, and the stability and speed are guaranteed.

This article was last updated on August 14, 2018, and has not been updated for more than one year. If the article content or picture resources are invalid, please leave a message for feedback, and we will deal with it in a timely manner. Thank you!

If you think this article is helpful, please sponsor this website

 Alipay scanning sponsorship WeChat scanning sponsorship

  • Alipay scanning sponsorship
  • WeChat scanning sponsorship
  • Statement: All text, pictures and other materials marked "Original on this site" are copyrighted Yaxi All, welcome to reprint, but please indicate the source;
    Current comments: 12 of which: visitors 0 bloggers 0
    Loading
    1. Five years ago (2018-09-02) 20th floor

      Nice one

    one two
    Comment

     doubt  naughty  Sad  Pick one's nose  scare  smile  lovely  A bad laugh  surprised  Daze  doubt  Soldiers  Snicker  Curse  Anger  roll one's eyes  applause  proud  Wipe away sweat  kiss  Cry  open the mouth and show the teeth  halo  strong

    share twelve thirteen 8,441
    Top