Skip to content

Commit

Permalink
[TASK] Ensure getBanners action does not get indexed by search engines
Browse files Browse the repository at this point in the history
Refs #215
  • Loading branch information
derhansen committed Sep 28, 2020
1 parent 12b9986 commit 316e4b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Classes/Controller/BannerController.php
Expand Up @@ -240,6 +240,9 @@ public function getBannersAction(
} else {
$ret = LocalizationUtility::translate('wrong_hmac', 'SfBanners');
}

$this->response->setHeader('X-Robots-Tag', 'noindex, nofollow');

return $ret;
}
}
15 changes: 14 additions & 1 deletion Documentation/Faq/Index.rst
Expand Up @@ -29,4 +29,17 @@ Can I use my own templates?
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Yes, this is possible since the extension is made with Extbase and
Fluid. You can configure template settings by TypoScript
Fluid. You can configure template settings by TypoScript

How to prevent banner links to get indexed by search engines
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Since version 5.0.1 the extension instructs search engines to not index the "getBanners" action. This is done
by sending a `X-Robots-Tag: noindex, nofollow` HTTP header in the "getBanners" action.

Additionally you should ensure, that banner links contain `rel="nofollow"` in your template.

You should also instruct search engines to not index links containing arguments of the extension. This can be done
by adding the following to your `robots.txt`::

Disallow: /*tx_sfbanners_pi1 # no banners
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Banner/ImageBanner.html
Expand Up @@ -4,7 +4,7 @@
<div class="banner banner-{banner.uid}">
<f:if condition="{asset.originalResource.properties.link}">
<f:then>
<f:link.action action="click" arguments="{banner: banner}" target="{banner.linkTarget}" pageType="{settings.clickPageTypeNum}">
<f:link.action action="click" arguments="{banner: banner}" target="{banner.linkTarget}" pageType="{settings.clickPageTypeNum}" rel="nofollow">
<f:image image="{asset}" />
</f:link.action>
</f:then>
Expand Down

0 comments on commit 316e4b3

Please sign in to comment.