Open roelvanhintum opened 7 months ago
Hi, any update on Craft 5 timeline?
Just wanted to bump this - are there plans to update this for Craft 5 or do should we find other solutions?
Co-ask
Same question here...
We have migrated to retour which has much better performance as well (if you have lots of redirects).
This is the migration I created:
public function safeUp(): bool
{
$sql = "INSERT INTO `retour_static_redirects` (`dateCreated`, `dateUpdated`, `uid`, `siteId`, `associatedElementId`, `enabled`, `redirectSrcUrl`, `redirectSrcUrlParsed`, `redirectSrcMatch`, `redirectMatchType`, `redirectDestUrl`, `redirectHttpCode`, `hitCount`, `hitLastTime`)
SELECT
`d`.`dateCreated`,
`d`.`dateUpdated`,
`d`.`uid`,
`s`.`siteId`,
0 AS `associatedElementId`,
`e`.`enabled`,
`src`.`redirectSrcUrl`,
`src`.`redirectSrcUrl` AS `redirectSrcUrlParsed`,
'pathonly' AS `redirectSrcMatch`,
'exactmatch' AS `redirectMatchType`,
`d`.`destinationUrl` AS `redirectDestUrl`,
609 - `d`.`statusCode` AS `redirectHttpCode`,
`d`.`hitCount`,
`d`.`hitAt` AS `hitLastTime`
FROM (
SELECT
`dolphiq_redirects`.`id`,
IF(`dolphiq_redirects`.`sourceUrl` NOT LIKE '%<%',
CONCAT('/', `dolphiq_redirects`.`sourceUrl`),
CONCAT(
'/',
SUBSTRING(`dolphiq_redirects`.`sourceUrl`, 1, LOCATE('<', `dolphiq_redirects`.`sourceUrl`) - 1),
'[^/]+',
SUBSTRING(`dolphiq_redirects`.`sourceUrl`, LOCATE('>', `dolphiq_redirects`.`sourceUrl`) + 1)
)
) AS `redirectSrcUrl`
FROM `dolphiq_redirects`
) AS `src`
JOIN `dolphiq_redirects` `d` ON `d`.`id` = `src`.`id`
JOIN `elements` `e` ON `d`.`id` = `e`.`id`
JOIN `elements_sites` `s` ON `d`.`id` = `s`.`elementId`";
$this->execute($sql);
$this->execute('CREATE TABLE dolphiq_redirects_backup AS SELECT * FROM dolphiq_redirects;');
$this->execute('TRUNCATE TABLE dolphiq_redirects');
return true;
}
Worked perfectly for us but no guarantees that it'll work for you - please check it and test it before using in production
Same here, any updates?
I am considering doing an export of my records and using Sprout Redirects. It has been updated for Craft 5 and has a free tier that should meet our needs. If this repo hasn’t been updated by the time I finish, I will post the results of my attempt here.
I am considering doing an export of my records and using Sprout Redirects. It has been updated for Craft 5 and has a free tier that should meet our needs. If this repo hasn’t been updated by the time I finish, I will post the results of my attempt here.
Being able to do a bulk import into Sprout Redirects has proved to be too big a challenge for me. If you're able to get that to work please post your method here. Thanks!
I am considering doing an export of my records and using Sprout Redirects. It has been updated for Craft 5 and has a free tier that should meet our needs. If this repo hasn’t been updated by the time I finish, I will post the results of my attempt here.
Being able to do a bulk import into Sprout Redirects has proved to be too big a challenge for me. If you're able to get that to work please post your method here. Thanks!
I wasn’t able to figure it out. I saw in Sprout’s documentation they mentioned an SEO import helper. I could not find it. Also, there doesn’t seem to be a way to import with FeedMe (the Sprout entries aren’t exposed in the CP as entries that can be imported into).
It seems like paying for Retour and using the migration above will be the easiest way if you have a lot of redirects to import. I looked through the list on the site I’m updating and many redirects are out-of-date and not worth saving, so I’ll just re-enter the essential ones by hand into Sprout.
Hi, thanks for the plugin! Are there any plans for Craft 5 support?