Project

General

Profile

Actions

Bug #56423

closed

Page shortcuts redirect with HTTP Status 301 and get cached on some devices

Added by Christoph Dörfel over 10 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
Start date:
2014-02-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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).


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Feature #73139: Allow to select redirect code for doktype shortcutRejected2016-02-05

Actions
Related to TYPO3 Core - Bug #73148: Wrong HTTP redirect statuscode for shortcut to selected pageRejected2016-02-05

Actions
Has duplicate TYPO3 Core - Bug #54508: Http Redirect 301 prevents browsers from retrieving the correct url after authenticationClosed2013-12-19

Actions
Actions #1

Updated by Gerrit Code Review over 10 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

Actions #2

Updated by Gerrit Code Review over 10 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

Actions #3

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

Actions #4

Updated by Christoph Dörfel over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Mario Colombo about 10 years ago

Is this really a good idea?

Please read https://forge.typo3.org/issues/15128

Actions #6

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 :)

Actions #7

Updated by Mathias Brodala almost 10 years ago

Somehow the link to the review server results in "Not found". Can someone fix this?

Actions #8

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

Actions #9

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

  1. 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;
    }
    }
  2. 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']) {
...

Actions #10

Updated by Dan Kleine (Untenzu) over 8 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.

Actions #11

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF