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 site to MSM: remap URLs with category IDs

May 11, 2011 8:28am

Subscribe [1]
  • #1 / May 11, 2011 8:28am

    Yuri

    315 posts

    Hello,

    i have joined 2 EE sites into single MSM installation.

    The sites had URL with category IDs indexed in search engines (like http://www.site2.com/index.php/category/C1)
    Now, as the sites has been joined into one MSM installation the category IDs obviously changed, so I have now http://www.site2.com/index.php/category/C101 instead.

    I don’t want to loose the existing search engine links, so want to remap old category URL to new ones.

    I tried adding to .htaccess rule like

    RewriteRule ^index\.php/category/C1/ /index.php/category/C101/ [R=301,L]

    but it does not work (no redirect happens)

    However

    RewriteRule ^category/C1/ /index.php/category/C101/ [R=301,L]

    DOES work (but is not what I need).

    Does anything in EE or index.php prevent the redirect from happening?
    Is there maybe a programmatic way of creating category redirect for certain MSM site?
    Any other suggestions?

  • #2 / May 11, 2011 5:43pm

    Kevin Smith

    4784 posts

    Hi Yuri—

    There’s nothing I know of within EE that helps redirect from the old category ID to the new ID after an MSM merge, and a quick search on Devot:ee didn’t turn anything up. It looks to me like this might end up having to be a custom Apache redirect.

    For future reference, you may want to consult this blog post: The Importance of Semantics: Displaying Categories. It goes into some detail about using category names instead of IDs in the category URL, and why it’s important. Though it doesn’t do much for this situation, it would definitely help you avoid this kind of problem again.

    I’ll leave this thread open for a few more days to see if anyone else in the community might have a better solution for you on this one.

    Kevin

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

ExpressionEngine News!

#eecms, #events, #releases