Project

General

Profile

Actions

Task #89563

open

Add redirect types

Added by Guido Schmechel over 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Should have
Category:
SEO
Target version:
-
Start date:
2019-10-31
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

Description

Compared to the extension yoast premium, there are still two types of HTTP missing:

410 Content deleted
451 Unavilable for legal reasons


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #93882: [FEATURE]: Allow "Redirects" with Status Code 410 for deleted files and PagesClosed2021-04-08

Actions
Actions #1

Updated by Benni Mack over 4 years ago

  • Status changed from New to Needs Feedback

Technically this isn't a redirect anymore then, right?

Actions #2

Updated by Guido Schmechel over 4 years ago

  • Assignee set to Richard Haeser
Actions #3

Updated by Guido Schmechel over 4 years ago

Maybe Richard can say a little bit about these http types?

Actions #4

Updated by Richard Haeser over 4 years ago

On https://yoast.com/which-redirect/ you can see the reasons for those two status codes.

I think the 410 should be used more often. See https://yoast.com/deleting-pages-from-your-site/ for more information about that.

The 451 is not used that much but can still be of value.

Actions #5

Updated by Richard Haeser over 4 years ago

  • Status changed from Needs Feedback to New
  • Assignee deleted (Richard Haeser)
Actions #6

Updated by Richard Haeser over 4 years ago

But indeed Benni, the 410 and 451 are technically no redirects and no target is necessary as well. Having those options might still be a good idea though.

Actions #7

Updated by Bastian Stargazer over 4 years ago

I upvote this feature request! After a huge website update I using the Redirect module to map the old page-structure to the new one.
But often not all old URLs having corresponding new ones. Currently I'm using a 301 (Moved Permanent) to redirect the old URL to the index-page, just to avoid a 404 not-found.
I thought about using the 303 (See other) for it, but not sure how Google respond to this.

After searching around for a while I also saw articles saying that 410 is good practice for this case.

Actions #8

Updated by Guido Schmechel over 4 years ago

I tried the subject. Extending the TCA is the least of the problems.

The status code > 400 is not accepted. The trigger seems to be $headers['location'] in file \typo3\sysext\core\Classes\Http\RedirectResponse.php. If I comment out this line, the HTTP code also applies. Otherwise 302 is taken.

I'm running out of ideas here, but maybe someone may need the information.

Actions #9

Updated by Gianluigi Martino about 4 years ago

For me it also doesn't work if i comment out "$headers['location'] in file \typo3\sysext\core\Classes\Http\RedirectResponse.php"
Created a Middleware and using "new RedirectResponse", but if i try to redirect with 410 or 404, it always redirect with the 302 statuscode (as mentioned by Guido Schmechel).

Have somebody a solution to resolve this problme?

Actions #10

Updated by Richard Haeser about 4 years ago

  • Assignee set to Richard Haeser
Actions #11

Updated by Guido Schmechel about 3 years ago

  • Related to Feature #93882: [FEATURE]: Allow "Redirects" with Status Code 410 for deleted files and Pages added
Actions

Also available in: Atom PDF