Redirecty - Redirects plugin for Kirby 2.1.0+

#Redirecty

##A 301 redirects plugin for Kirby CMS

Most of the time when bringing over a non-CMS site into a CMS, you get a ton of new URLs that need to be redirected. Routing works great for URLs that match specific patterns, but usually you’ll get a lot of URLs that don’t work well for routing.

Redirecty mimics the 301 redirection functionality of some WordPress plugins, while also including search and replace functionality within your content, and CSV/JSON import/exports of your redirects list.

####Example blueprint:

title: Redirects
pages: false
files: 
  type:
    - code
    - document
fields:
  title:
    label: Title
    type: text
  redirects:
    label: Redirects
    type: structure
    style: table
    fields:
      old:
        label: Old URL
        type: text
        icon: times
      new:
        label: New URL
        type: text
        icon: check
      external:
        label: External
        text: Is it an external link?
        type: checkbox
        icon: share

7 Likes

Is it correct, that this plug-in does not support multi-langual sites?

I get an error, related to a multi-langual set-up, when I trigger the redirecty(); function…

I’ve uploaded a quick fix on the dev branch of the repo that prepends the language URL set up in the config file when the config variable ‘language.detect’ is set to true.

This just handles more basic multilanguage setups, since it doesn’t account for pages that have URL keys set. I’ll update this thread when we get the fuller fix implemented. We personally haven’t had any full multilanguage sites to use this on, so thank you for pointing it out!

1 Like

This issue is now fixed with v1.0.2 of the plugin. When ‘language.detect’ is set to true in the config, the plugin will find the appropriate version of the page based on the language code, and will use URL keys when available.

Just a note on that functionality: when a user is redirected to a page with a language that does not match the site’s default language, they will get a 302 redirect. Default language users will still get a 301. This is done so that you don’t get different 301s from the same original request – probably wouldn’t be great for SEO. If you’d like to change that behavior, setting c::set('redirecty-multi', 301) will change that back to a 301 redirect.

3 Likes