When I have access to a WordPress blog, I want to force HTTP when I have access to WordPress via XMLRPC otherwise forcing https

When I have access to a WordPress blog, I want to force HTTP when I have access to WordPress via XMLRPC otherwise forcing https

0 minutes, 58 seconds Read

ruby 2.6.6
ubuntu 24.04
WordPress 6.8.1

I have a Ruby script that uses XML-RPC to post articles on my blogs. XMLRPC does not work above HTTPS in the Ruby world; It only works via HTTP.

However, the blogs are forced to https via .htaccess, as below.

The current .htaccess file is:

# rewrites any URL to use HTTPS and prepends the www subdomain if missing


  RewriteEngine On

  # Preserve Authorization header
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  # Redirect to https://www. only if not already using both
  RewriteCond %{HTTPS} off [OR]
  RewriteCond %{HTTP_HOST} !^www\. [NC]
  RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*)$ [NC]
  RewriteRule ^ https://www.%1%{REQUEST_URI} [L,R=301]

  # Handle internal routing for CMS
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.php [L]
 

This works great.

I have tried a AAPPATCHING XMLRPC :: Client (Ruby version) to accommodate certificates without success.

I am looking for .htaccess as a feasible solution.

The problem is to ensure that the HTTP access schedule remains if the blog is accessible via XML-RPC; Otherwise, https force (as above).

I am looking for guidelines for changing the .htaccess file to meet both scenarios.

#access #WordPress #blog #force #HTTP #access #WordPress #XMLRPC #forcing #https

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *