Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not create redirect for expired page #139

Open
jonasboman opened this issue Oct 18, 2024 · 2 comments
Open

Do not create redirect for expired page #139

jonasboman opened this issue Oct 18, 2024 · 2 comments

Comments

@jonasboman
Copy link

I am creating a scheduled job in optimizely cms 12, that should expire a page (based om some parameters) and also move the page.
After that I wish to create a custom redirect to the old parent.

Having some issues with this.

It seems like NotFound has a Moved event hooked up that creates Redirects even on expired pages.
When I use IRedirectService and AddOrUpdate method, it works, but I think the move-event (e g MovedContentRegistratorBackgroundService ) is lagging and overwrites the redirect I am creating.

Is there a way around this?

  1. Finding pages (with conditions)
  2. Iterate; Set page as expired, move to specifik page
  3. Create redirect:
    _redirectsService.DeleteByOldUrl(oldPageUrl); _redirectsService.AddOrUpdate(new CustomRedirect(oldPageUrl, parentPageUrl, true, RedirectType.Temporary));
@jonasboman
Copy link
Author

@valdisiljuconoks do you have any input here? :)

@jonasboman
Copy link
Author

Perhaps add logic in ContentUrlHistoryEvents to also take into consideration if the moved page is published or not.
I guess I could use my own implementation of ContentUrlHistoryEvents. :)

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

No branches or pull requests

1 participant