Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Migrate realurl redirects to sys_redirect (TYPO3 9 core)
INSERT INTO `sys_redirect` (source_path,target,hitcount,target_statuscode,source_host) SELECT CONCAT('/',url),destination,counter,301,d.domainName FROM `tx_realurl_redirects` r LEFT JOIN sys_domain d ON r.domain_limit = d.uid;
UPDATE sys_redirect SET source_host = '*' WHERE source_host = '';
@frans-beech-it

This comment has been minimized.

Copy link

frans-beech-it commented Jun 13, 2018

If you want to migrate EXT:url_forwarding redirect (only internal without additional parameters + external)

INSERT INTO `sys_redirect` (source_path,target,hitcount,target_statuscode,source_host) SELECT CONCAT('/',forward_url),CONCAT('t3://page?uid=',internal_page),counter,http_status,d.domainName FROM `tx_urlforwarding_domain_model_redirect` r LEFT JOIN `tx_urlforwarding_domain_mm` mm ON r.uid = mm.uid_local LEFT JOIN `sys_domain` d ON mm.uid_foreign = d.uid WHERE r.type = 0;
INSERT INTO `sys_redirect` (source_path,target,hitcount,target_statuscode,source_host) SELECT CONCAT('/',forward_url),external_url,counter,http_status,d.domainName FROM `tx_urlforwarding_domain_model_redirect` r LEFT JOIN `tx_urlforwarding_domain_mm` mm ON r.uid = mm.uid_local LEFT JOIN `sys_domain` d ON mm.uid_foreign = d.uid WHERE r.type = 1;

UPDATE sys_redirect SET source_host = '*' WHERE source_host = '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.