The TYPO3 core seo extension adds every given parameter from the request to the generated canonical URL.
This extension helps to prevent unwanted parameters in the canonical URL.
By default parameters within the namespaces from active extensions (e.g. tx_news_pi1
) using Extbase are allowed.
This still allows parameters not used by these extensions like tx_news_pi1[wtf]=seo
.
If you need to include third-party parameters or parameters for extensions based on \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
(aka pi based) or need to be very strict, disable the setting and/or use the explicit whitelist.
In addition to or as replacement for the allowed namespaces from active extension Extbase plugins (see above), you can set a whitelist if you need to allow additional parameters or want to specify exactly which parameters are allowed. Go to Admin Tools > Settings > Extension Configuration and select seo_canonical_guard and set the allowed parameters or parameter namespaces as follows:
parameter1, parameter2, namespace_xy\[(.*?)\], namespace_yz\[(explicit1|explicit2)\]
You can add a list of single parameters or use regular expressions (you can omit the /…/
around, but you have to escape special characters).
The extension depends on the TYPO3 core seo extension.
Require the latest package:
composer require wazum/seo-canonical-guard
The extension is inspired by https://github.com/sourcebroker/urlguard
which definitely should be installed too if you use the addQueryString
when creating links with TypoScript!
You like this extension? Get something for me (surprise! surprise!) from my wishlist on Amazon or help me pay the next pizza or Pho soup (mjam). Thanks a lot!