numero2/contao-xmlrpc

Installs: 34

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Type:contao-module

v1.0.1 2019-01-24 09:05 UTC

This package is auto-updated.

Last update: 2024-06-25 06:17:55 UTC


README

XML-RPC for Contao

About

Provides an XML-RPC interface for Contao similar to the one from Wordpress.

System requirements

Installation

  • composer require numero2/contao-xmlrpc
  • save username and password in Contao backend -> settings

.htaccess

Add the following line to your .htaccess inside the <IfModule mod_rewrite.c> block to make the XML-RPC interface accessible from within your document root rather than just the modules subdirectory.

RewriteRule xmlrpc\.php system/modules/xmlrpc/xmlrpc\.php [L]

To prevent caching of responses add the following snippet before your <IfModule mod_rewrite.c> block.

<FilesMatch "xmlrpc.php">
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access"
    </IfModule>
</FilesMatch>

Because tools like Scompler might like to link directly into the Wordpress backend we need an extra rewrite to handle those to correctly redirect to Contao. So add the following snippet after the RewriteRule from above.

RewriteCond %{REQUEST_URI} wp-admin/post\.php [NC]
RewriteCond %{QUERY_STRING} ^action=edit&post=(.*)
RewriteRule (.*) contao?do=news&table=tl_content&id=%1 [R=301,L]