Using the JSON API via HTTPS and HTTP

admin2025-01-07  3

We have developed a mobile application using the JSON API plugin.

The current website is running on HTTP, we are planning to change the website to HTTPS.

Currently, mobile users on the live app are on HTTP; if we change the website to HTTPS then the app doesn't work so we have to publish a new app to work on HTTPS, but then the old app will not work, and we can't force a user to upgrade the app to the latest version.

We have a solution but we don't how to implement it: to make the website HTTPS and only the JSON API plugin to work on HTTP and HTTPS. How can we do this?

We have developed a mobile application using the JSON API plugin.

The current website is running on HTTP, we are planning to change the website to HTTPS.

Currently, mobile users on the live app are on HTTP; if we change the website to HTTPS then the app doesn't work so we have to publish a new app to work on HTTPS, but then the old app will not work, and we can't force a user to upgrade the app to the latest version.

We have a solution but we don't how to implement it: to make the website HTTPS and only the JSON API plugin to work on HTTP and HTTPS. How can we do this?

Share Improve this question edited Apr 7, 2018 at 12:55 Glorfindel 6093 gold badges10 silver badges18 bronze badges asked Apr 7, 2018 at 11:24 sevougsevoug 211 gold badge1 silver badge6 bronze badges 0
Add a comment  | 

2 Answers 2

Reset to default 0

You can serve your site on both protocols http and https. This might be problem if you care about SEO (duplicate content).

You can use 301 redirection to force users to be redirected from http to https. Old app will be slightly slower because of redirection but it will be working. This might be problem if you use POST requests. There is 307 redirection but I don't have any experience with it.

Whether HTTP or HTTPS should not make any difference. You should configure your webserver to "invoke" wordpress stack on both protocols requests to the domain and that should be enough (and this should be kind of default and recommended way in all relevant web server tutorials).

You can still change your web site URL to HTTPS, and that will mostly redirect all traffic to front end pages to HTTPS, but should not have impact on the REST API.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736259721a610.html

最新回复(0)