0

On a event-centered site we have a lot of recurring events, but there's no pattern like every first monday etc. So the editors just clone the event with node-clone and with pathauto we generate a date-token that is appended to the url.

After the date is gone, these events are deprecated and get unpublished (by Rules). But still people find links to these events via search engines and the like.

How can we automatically redirect links of past events to a up-to-date one?

Right now the url looks like this: www.mydomain.com/events/eventname-300518 (which would be today the 30th of May)

I could add a "basic" event without the date token if that would help. So if a event gets unpublished a redirect to the basic node could take place.

Can you point me in the right direction?

1 Answer 1

1

Rules and Redirect

Since you're already using Rules to automatically Unpublish past events, you could try adding an Action that creates a Redirect from the unpublished node path to the latest one. You'll need a Redirect module that provides Redirect actions. I haven't tried this but I expect Redirect module to have that.

Match Redirect

Or you could use the standalone solution Match Redirect.

Server side Redirect

Redirects don't have to be handled within Drupal. You could create Rewrite rules in your server configuration too.

But this all might be the solution for the wrong problem.

Better structure within Drupal

If the original event information doesn't change, and you only change the times, maybe you should structure it with 2 different content types, Event and Event instance or something that makes more sense.

The Event would hold everything except the times, and the Instances would only hold times. Then use Entity references to connect Instances to their Events.

Use Views to display Instances information on Events (Block or Attachment), you can use Views to filter out only future dates to display on Event nodes. And when marketing your event only ever share link to the Event node, that will always be showing correct relevant dates through the power of Views.

You can set your robots.txt to not index Instance content nodes on search engines, and in general don't link to them or show them to the users, only use the Instance information on Event nodes.

Or if you have per-date relevant information for the event (comments or similar), store it on the Instance node, and then again with the power of Views you can list past event info on the Event node itself, if anyone wants to read, look at past image gallery or similar.

That way you'd have both the future and past info available to be displayed how you want them, and only one Event link for marketing that would probably even be beneficial for SEO ranking.

5
  • He could also add the dates field to the Event content type with an unlimited limit. He could hide the field and using Views and EVA he could add a view to the page that gets the NID (from url) and shows the event dates that are greater than today’s (at 00:01 probably).
    – rovr138
    Commented Jun 2, 2018 at 5:26
  • That's a great idea @rovr138! Why not add that as your answer?
    – prkos
    Commented Jun 2, 2018 at 13:22
  • I wanted to get something out. I can probably add that today and expand on it. I’ve used a similar approach on some sites.
    – rovr138
    Commented Jun 2, 2018 at 14:40
  • Thx, great input, i just came back to this issue eventually...!
    – Volker
    Commented Jul 12, 2019 at 10:46
  • that is not lost that comes at last :)
    – prkos
    Commented Jul 12, 2019 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.