2017 © Pedro Peláez
 

contao-module contao-multidomain-rebuild-index

Mini extension that makes rebuilding the search index possible for multidomain.

image

fritzmg/contao-multidomain-rebuild-index

Mini extension that makes rebuilding the search index possible for multidomain.

  • Monday, November 6, 2017
  • by fritzmg
  • Repository
  • 1 Watchers
  • 2 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

, (*1)

Contao Multidomain Rebuild Index

Rebuilding the search index via the backend of Contao actually creates an AJAX request for every page in the sitemap of every website root of the Contao installation. Thus, in order to be able to rebuild the search index in multidomain installations you need to set custom response headers for any page request that Contao handles, due to CORS. The headers are:, (*2)

Access-Control-Allow-Headers: X-Requested-With
Access-Control-Allow-Origin: …

The first header is necessary, because Contao uses the MooTools Request class, which always adds the X-Requested-With request header (see mootools.net/core/docs/1.5.2/Request/Request). The second header allows AJAX requests from other domains., (*3)

Adding these headers could be done via the .htaccess:, (*4)

<IfModule mod_headers.c>
  Header set Access-Control-Allow-Headers X-Requested-With
  Header set Access-Control-Allow-Origin http://example.org
</IfModule>

The value for the Access-Control-Allow-Origin header should be changed to the domain (and scheme) with which you access the Contao back end., (*5)

However this does not work in every server environment for requests that are handled by PHP via FastCGI for example (see http://serverfault.com/a/383063/143519). In that case you would need to set these headers directly in the vhost configuration of Apache., (*6)

This extension helps with cases where that is not possible. By installing this extension the headers are automatically set for any front end page output. The Access-Control-Allow-Origin header is automatically set to the domain with which you accessed the Contao back end. No configuration is needed for this extension., (*7)

Note: further problems can arise, if you use HTTPS on some of the domains. AJAX requests to resources via HTTP are not possible when using HTTPS. In that case you need to make sure that you either:, (*8)

  • log into the backend via HTTP
  • or force HTTPS for all domains

Note: this extension is not needed, if you use Contao ^3.5.25 or Contao >=4.3.6., (*9)

The Versions

06/11 2017

dev-master

9999999-dev http://www.inspiredminds.at

Mini extension that makes rebuilding the search index possible for multidomain.

  Sources   Download

LGPL-3.0+

The Requires

 

search contao index multidomain rebuild

24/11 2016

1.0.3

1.0.3.0 http://www.inspiredminds.at

Mini extension that makes rebuilding the search index possible for multidomain.

  Sources   Download

LGPL-3.0+

The Requires

 

search contao index multidomain rebuild

22/11 2016

1.0.1

1.0.1.0 http://www.inspiredminds.at

Mini extension that makes rebuilding the search index possible for multidomain.

  Sources   Download

LGPL-3.0+

The Requires

 

search contao index multidomain rebuild

20/11 2016

1.0.0

1.0.0.0 http://www.inspiredminds.at

Mini extension that makes rebuilding the search index possible for multidomain.

  Sources   Download

LGPL-3.0+

The Requires

 

search contao index multidomain rebuild