TYPO3 - canonical tag

870 views Asked by At

I would like to add a canonical tag which points to another domain.

My TYPOScript looks like this:

temp.canonical = TEXT
temp.canonical {
  typolink {
    parameter.data = TSFE:id
    returnLast = url
  }
  wrap = <link rel="canonical" href="http://myotherdomain.com/|" />
}
page.headerData.123 < temp.canonical

Unfortunately this returns the full URL instead of the path which results in the following:

<link rel="canonical" href="http://myotherdomain.com/http://example.com/subpage" />
1

There are 1 answers

0
Paul Beck On

Funny... I always have to configure the typolink

forceAbsoluteUrl = 1 

to get a full link. Probably this is caused because in the most projects of me I've configured

config.baseUrl = http://example.com/

Maybe this will help you to not get a full URL but attention that your system is still working correctly after setting a baseUrl if you didn't configure it earlier. Are there maybe other settings in your config. that could be the reason for this problem?