Thanks to Kleins answer and a lot of community support I've now managed to set up a solution that is working great.
First of all, when working with extension realurl rewriting, remember to delete realurl_autoconf.php
and clear both typo3 and realurl cache during testing. Also check if realurl variables are applied in the typo3 Configuration Module
Solution 1, raw config
Just copy you config to ext_localconf.php
Solution 2, externalized config
This is more advanced and worked great for me. (Not sure if Kleins solution might be even better).
Create namespace class in Classes/RealUrlConf.php
and include it in ext_localconf.php
. Make sure to follow typo3's required conventions of filepath/namespace configuration.
Classes/RealUrlConf.php
: https://pastebin.com/sg836BhJ
ext_localconf.php
:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/realurl/class.tx_realurl_autoconfgen.php']['extensionConfiguration']['coreRealUrlConf'] = 'Micke\\GenCore\\RealUrlConf->realUrlConfigurer';
If you want to use the setup just like this you can uncomment the definition and application of the pageIds in the Classes/RealUrlConf.php
.
Solution 3, separate core config from site extensions
I have created a core package that is drawn as a dependency from the individual site packages in our installation. So in my case I'm settings only the configuration (without yet applying the pageIds) in the core, which is the config mentioned above. In this case without uncommenting anything.
For each individual sitepackage I then set up a similar configuration that just defines pageIds and applies the core configuration to them. In this was the pageIds are isolated in the individual site packages while most of the configuration resides in the core.
Classes/RealUrlConf.php
: https://pastebin.com/A2xUvrJm
ext.localconf.php
:
// Include realurl configuration with page IDs
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/realurl/class.tx_realurl_autoconfgen.php']['extensionConfiguration'][$_EXTKEY . 'realUrlVars'] = 'Micke\\RieSitepack\\RealUrlConf->realUrlConfigurer';
Good Luck!