0

I have some problems with realURL Cache. For example:

The URL to the "home"-page is /the-shoe/home. Translated to switzerland (german) the url is: /ch/der-schuh/home. The problem here is that the URL /ch/the-shoe/home also works.

My idea was, that this is a cache problem. Because the page got translated and the page got called before the title of the page got translated

So I tried to clean the cache with the backend-module "Speaking URLs". I Flush all entries in the URL Cache and deleted the paths für this page and language in the Path Cache.

But this did not change anything. I can still call /ch/der-schuh/home and /ch/the-shoe/home and both works. After calling both URLs I can also see them again in the URL Cache (but not in the Path Cache): enter image description here

So why is this a problem

  • I do not want 2 URLs lead to the same content
  • Sometimes <f:link_page> and co. creates a Link with the "wrong" URL (not the translated one).
  • When I am logged in in the backend the "wrong" URL will not work!

Now my question is, where is this problem coming from? How can I solve it? It looks like just clearing the cache does not solve the problem.

ANy ideas?

nbar
  • 6,028
  • 2
  • 24
  • 65

2 Answers2

4

This is a RealURL bug, which I actually had fixed once by patching RealURL (that was in RealURL v1 back then, but I'm sure you will figure out the line of code where it is now).

With this patch applied, it is NOT possible anymore to access a translated page with the original page title in it (which my project needed to avoid duplicate content & pages).

diff --git a/realurl/class.tx_realurl_advanced.php b/realurl/class.tx_realurl_advanced.php
index 5af10a6..2860eb1 100644
--- a/realurl/class.tx_realurl_advanced.php
+++ b/realurl/class.tx_realurl_advanced.php
@@ -1073,6 +1073,11 @@ class tx_realurl_advanced {
                // Process titles. Note that excluded segments are also searched
                // otherwise they will never be found
                $uidTrack[$row['uid']] = $row;
+               // If the page has a page translation, don't add the titles from the default language to the list
+               // of valid pages, the translation is processed below.
+               if ($this->pObj->getDetectedLanguage() > 0) {
+                   continue;
+               }
                foreach ($segTitleFieldArray as $fieldName) {
                    if ($row[$fieldName]) {
                        $encodedTitle = $this->encodeTitle($row[$fieldName]);
Benni
  • 1,109
  • 5
  • 3
  • Hey thanks. As you say this is for version 1.x. Version 2.x is too different. Also there was the config `languageGetVar` for `pagePath` that is supposed to do exactly that. – nbar Sep 06 '16 at 13:34
  • To avoid duplicate content penalty, your should set the canonical URL (e.g. with typolink in TS). – pgampe Sep 08 '16 at 17:58
0

The issue is halffixed in realURL v2.0.14.

Best fix for now is to disable cache for realURL.

nbar
  • 6,028
  • 2
  • 24
  • 65
  • I do not think that disabling caches makes your website work better ;) Better report a bug to `realurl` and hope that Dmitry fixes the bug sooner than later (a little monetary motivation might help). – pgampe Sep 08 '16 at 17:57