Bug #73148
closedWrong HTTP redirect statuscode for shortcut to selected page
0%
Description
If an editor uses the shortcut feature for pages, then TYPO3 redirects to the desired target page. The HTTP statuscode for the redirect is »307«. SEO guys complained to me, that this status code is wrong, when redirecting to explicitly selected pages.
I remembered that this redirect used 301 in the past and and after a quick search I found the reason for this change in ticket #56423. In this ticket the author criticizes that the redirect used »301« for all redirects except random subpages. The discussion correctly pointed out, that shortcuts to rather random pages (like „First Subpage“ or „Random Page“) are dynamic and subject to change, and therefore should use 307 as statuscode.
Instead of switching the condition for type of the shortcut the applied solution was to remove the condition completely and now use »307« for all redirects.
As stated above this is wrong. When the editor sets a shortcut to an explicitly selected page, then TYPO3 should use 301 as statuscode. If the editor uses one of the three other shortcut types currently possible, then statuscode 307 should be used.
I would like to send a patch to fix the previously applied patch of ticket 56423. The bug was introduced in 6.2 and now exists in all supported TYPO3 Versions.
Updated by Gerrit Code Review almost 9 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/46500
Updated by Riccardo De Contardi almost 9 years ago
duplicate of https://forge.typo3.org/issues/73139 and https://forge.typo3.org/issues/69330 ?
Updated by Dan Kleine (Untenzu) almost 9 years ago
Oh, just saw in Gerrit that Gerald Aistleitner is working on the same topic right now → refs ticket #73139 :)
@Ricardo #73139 is a duplicate of #69330 - But this one here is a bugfix for shortcut redirect introduced in #56423, Gerald however is working on a feature to allow selection of statuscode. Same topic, but diffent objectives.
Possible scenario: Merge #73148 into master, 7.6 and 6.2, then merge #73139 into master.
Updated by Riccardo De Contardi almost 9 years ago
Thanks, Dan. Can I close yours?
Updated by Dan Kleine (Untenzu) almost 9 years ago
No. I would like to see this fix in the affected TYPO3 versions. The feature Gerald is working on covers the same topic indeed, but, well, its a feature.
(I edited my answer (note 3) previous to your question, maybe this explains a bit more what I meant).
Updated by Riccardo De Contardi almost 9 years ago
thank you for your good explanation; I'll close #69330
best regards
Updated by Andreas Wolf over 8 years ago
- Status changed from Under Review to Rejected
The core team now pretty much decided that this should be done in an extension and not in the core. The main reason is that most editors won’t get the difference and it clutters the system. Additionally, 301 redirects offer a good possibility to shoot yourself in the foot, as they are cached by browsers, so a later change by an editor won’t be so easy.
I did not really check it, but I think this should be easy to implement using the default core hooks. If you need anything special to get it done, get in touch with us (e.g. in #typo3-cms-coredev on Slack).
Updated by Dan Kleine (Untenzu) over 8 years ago
Hey guys, thanks for the review and explanation why this patch set was rejected.
As suggested I created an extension which applies the given patch to the core:- »Shortcut Statuscodes« https://typo3.org/extensions/repository/view/shortcut_statuscodes
This is a patch extension only. If you want to let editors manage shortcuts to their own needs,
then you should take a look into the following great extensions:
- »URL Forwarding« by Patrick Broens https://typo3.org/extensions/repository/view/url_forwarding
- »My Redirects« by Benjamin Serfhos https://typo3.org/extensions/repository/view/my_redirects