Bug #56423
closedPage shortcuts redirect with HTTP Status 301 and get cached on some devices
100%
Description
We recently had the problem of iOS caching redirects caused by the page shortcut mode "link to first subpage".
In TypoScriptFrontendController::checkPageForShortcutRedirect() the only exception from the standard 301 redirect is SHORTCUT_MODE_RANDOM_SUBPAGE, which is a 307 redirect.
I believe that all shortcut modes except for SHORTCUT_MODE_NONE should be handled as 307 redirects, since shortcuts are dynamic and subject to change.
Of course SEO experts won't be too happy about such a code change but at least the chance for errors would be reduced significantly (and developers' headaches too).
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27933
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27933
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27933
Updated by Christoph Dörfel over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset d404982b31bd902fa108b3e677a27759b4f87de5.
Updated by Mario Colombo about 10 years ago
Is this really a good idea?
Please read https://forge.typo3.org/issues/15128
Updated by Christoph Dörfel about 10 years ago
Mario Colombo wrote:
Is this really a good idea?
Please read https://forge.typo3.org/issues/15128
Hi Mario
From a technical point of view (NOT a SEO point of view as I stated before) this is the correct behaviour (using a temporary redirect on a link that is subject to change).
IMHO the method of redirection should be configurable (to a 301 redirect if you so desire) but the default behaviour should be a temporary redirect because this solves some serious technical problems (blame iOS).
Can we agree on making a feature request for choosing the type of redirect (or setting it globally through TYPO3_CONF_VARS)? That would be the best solution for both of us I guess :)
Updated by Mathias Brodala about 10 years ago
Somehow the link to the review server results in "Not found". Can someone fix this?
Updated by Lars Zimmermann almost 10 years ago
Hi guys,
TYPO3 seems to use HTTP Status 307 for all page shortcut modes. This is really bad from a SEO point of view as stated above. Could you pls make this at least configurable for people who still want to use a 301 HTTP status for the starting page shortcut?
Thank you very much!
Lars
Updated by Johannes Hahn over 9 years ago
Hi,
i give Lars Zimmermann my vote.
I think it's a bad practice to change this hardcoded to 307.
This bugfix does not fix the problem. It causes the next generation of bugs.
Why not write it like in the jumpUrl function: same php file near line: 3029
- code example #####
$statusCode = HttpUtility::HTTP_STATUS_301;
if ($TSConf['TSFE.']['jumpURL_HTTPStatusCode']) {
switch ((int)$TSConf['TSFE.']['jumpURL_HTTPStatusCode']) {
case 301:
$statusCode = HttpUtility::HTTP_STATUS_301;
break;
case 302:
$statusCode = HttpUtility::HTTP_STATUS_302;
break;
case 307:
$statusCode = HttpUtility::HTTP_STATUS_307;
break;
}
} - code example #####
ps.: from seo view this line is also not really correct.
//jumpUrl function:
3099: $statusCode = HttpUtility::*HTTP_STATUS_303*;
if ($TSConf['TSFE.']['jumpURL_HTTPStatusCode']) {
...
Updated by Dan Kleine (Untenzu) almost 9 years ago
Hey guys, you may want to take a look into https://forge.typo3.org/issues/73148#note-8 if you still need 301 redirects.