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.

Routing traffic to changed URL

September 22, 2011 3:47pm

Subscribe [1]
  • #1 / Sep 22, 2011 3:47pm

    Russ Back

    142 posts

    Hi

    I’ve been grappling with a basic rewrite rule as we’ve changed a template name from template-a to template-b and need to 301 all links to the new template-b URLs. Example:

    /trusted-installers/template-a/something-here/and-possibly-here

    Should be 301 redirected to:

    /trusted-installers/template-b/something-here/and-possibly-here

    I know I need a pattern match and R=301 but so far I’ve not got this to work quite right. Any quick suggestions would be very gladly received.

    Thanks again for your help

    [Mod Edit: Moved to the Community Help forum]

  • #2 / Sep 23, 2011 6:57am

    Russ Back

    142 posts

    Fixed:

    # rewrite /trusted-installers/detail/x/y/z to /trusted-installers/roofing-contractors/x/y/z
    RewriteRule ^index.php/trusted\-installers/detail/(.*)$ /trusted-installers/roofing-contractors/$1 [R=301]

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

ExpressionEngine News!

#eecms, #events, #releases