0

I am using the following Typoscript code to generate hreflang tags dynamically.

lib.hreflang = HMENU
lib.hreflang {
    special = language
    #Sprach IDs eintragen
    special.value = 0,1
    1 = TMENU
    1 {
        NO = 1
        NO {
            stdWrap.cObject = TEXT
            stdWrap.cObject {
                value = de-AT || de-DE
            }
            linkWrap = <link rel="alternate" hreflang = "|
            doNotLinkIt = 1
            after.cObject = TEXT
            after.cObject {
                stdWrap {
                    wrap = " href=" | " />
                    typolink {
                        parameter.data = page:uid
                        additionalParams = &L=0 || &L=1
                        returnLast = url
                        #inkl baseurl
                        //forceAbsoluteUrl = 1
                        #ignore querystrings
                        addQueryString = 1
                        addQueryString.method = GET
                        addQueryString.exclude = L,id,cHash,no_cache,gclid,utm_source,utm_medium,utm_campaign
                        no_cache = 0
                    }
                }
            }
        }
    }
}

It works well - but when I override the path in the page settings of Typo3, it ignores my overrides.

enter image description here

For example I have this page: /blog/nature/ and override the path to /nature/. Then the hreflang generated by my script still points to /blog/nature/, which is not ideal, because this site results in a redirect to /nature/.

ESP32
  • 8,089
  • 2
  • 40
  • 61
  • Maybe silly, but you did clear all the cache didn't you ? especially the realurl one ... next one, you do not have anything regarding in .htaccess or the realurl_config.php. – webman Oct 17 '18 at 11:35
  • @webMan: thank you - yes, I deleted the cache - but now I've found the reason for my problem: I did not override the path in the translation. *facepalm* – ESP32 Oct 17 '18 at 11:46

0 Answers0