Most of this seems irrelevant after a number of Debugging. Read EDIT2 for what you need to know.
I recently took over development of a TYPO3 webpage and added two new postVars to the realurl_conf.php
It works as expected on the primary language, but on some pages when viewing it in a different than the primary language I fall into a redirect loop.
The loop (Temporary Redirect - Code 307) can be reproduced by opening a website, like http://example.com/subpage/?L=2 where 2 is the language ID for English and subpage
is the title in English. If I open the page via the link http://example.com/unterseite/?L=2 I get the correct page, while unterseite
is the title of the page in the primary language.
Unfortunately I am unable to see the pattern, as to which pages are affected. A total of 3 pages show this misbehaviour, two having child-subpages and the third being a standard page with no children. The other 11 pages work as expected, with 2 other pages having children.
All pages are of the standard content type.
A failing realurl_conf.php looks like this:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
'_DEFAULT' => array (
'pagePath' => array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
),
),
);
I do not seem to find the issue and I've been googling about it for the last week.
Any hint or specific help is very much appreciated.
EDIT: removed unneccessary lines. The problem occurs reliably with the remaining code With the tx_realurl class (not advanced), the problem does not occur, but the behaviour is not as expected.
EDIT2: After a lot of Xdebug debugging, I realized that there is a page with a title say Subpage and there is a secondary menu that contains a link to that page. When opening the URL example.com/subpage/ it detects that subpage is a link to subpage and redirects to subpage. So what I am looking for is a way to give pages precedence over links, if there is more than one match.