ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Moving entries, want to redirect properly

June 29, 2012 6:08am

Subscribe [2]
  • #1 / Jun 29, 2012 6:08am

    vodkafish

    122 posts

    I’m moving a good number of entries from one channel to another.  These entries were all under a category, but after a while it makes more sense for it to have its own channel and a few different fields.

    The new channel will have a new URL structure (a new template group & template).

    I’d like to move all of the old entries and have EE redirect to the new template properly.

    What’s the best way within EE to accomplish this?

    Best logic?:
    if entry = new channel && segment 2 != new template group
    then redirect to template group/ template/ entry

    Leads me to:

    {if channel=="new_channel" && segment_2 != "new_template_group"}
    {redirect ?}
    {/if}

    How do I specify the entry name in the redirect?  Any attempt I’ve made has failed and I’ve only been able to redirect to index or static pages.

  • #2 / Jul 02, 2012 11:31am

    vodkafish

    122 posts

    For those those are in the same situation, you can use url_title and such inside the redirect, I just never tried it with another set of {}

    Sample:

    {exp:channel:entries limit="1"}
    {if channel_short_name=="new_channel"}
      {redirect="new-template-group/template/{url_title}"}
    {/if}
    {/exp:channel:entries}
  • #3 / Jul 02, 2012 1:12pm

    Shane Eckert

    7174 posts

    Hey VodkaFish,

    Thank you for posting your question here on the ExpressionEngine forums.

    Are you all set now? Is there anything else I can help with?

    Cheers,

  • #4 / Jul 02, 2012 9:22pm

    vodkafish

    122 posts

    I’m set

  • #5 / Jul 03, 2012 4:56pm

    Shane Eckert

    7174 posts

    Hi VodkaFish,

    Glad to hear it!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases