Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Craft 5 support #141

Open
roelvanhintum opened this issue Apr 22, 2024 · 9 comments
Open

Craft 5 support #141

roelvanhintum opened this issue Apr 22, 2024 · 9 comments

Comments

@roelvanhintum
Copy link

Hi, thanks for the plugin! Are there any plans for Craft 5 support?

@pbd-dev
Copy link

pbd-dev commented Apr 30, 2024

Hi, any update on Craft 5 timeline?

@TUSAB-web
Copy link

Just wanted to bump this - are there plans to update this for Craft 5 or do should we find other solutions?

@Siyabulela
Copy link

Co-ask

@cyberfly999
Copy link

Same question here...

@klaus-gsma
Copy link

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

@celo4ever
Copy link

Same here, any updates?

@TUSAB-web
Copy link

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.

@99ster
Copy link

99ster commented Aug 2, 2024

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!

@TUSAB-web
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants