3

Is there a way to automatically create a 301 redirect on a structure entry if it gets reordered into a new group. For example the original entry lives under /section-1/entry-title and it gets moved to /section-2/entry-title. So if the original url is indexed it gets redirected to the new location without the client needing to do anything.

Thanks for the help

1

Nothing clever I can think of, but it's an interesting idea.

You can either manually setup the redirects in your .htaccess file, or there are a couple of plugins that appear to let you manually manage redirects from the control panel.

A feature request to the plugin developers might be to get them to add support to listening to an (as-of-yet non-existent) "onMoveStructuredEntry" event in Craft that automatically creates the redirect for you.

  • I'd like to see that onMoveStructuredEntry event. It would be great if a plugin had the ability to step in and make it near-impossible for a website user to create broken links. – Ben Parizek Aug 4 '14 at 18:09
  • I like the idea as well, though if auto-creating redirects ever became built into Craft, expect to get users somehow accidentally creating redirect loops if there isn't some sort of check for it. Drupal's Redirect module auto-redirects when a path has been changed, but if someone makes a change and then changes it back, it starts redirecting to itself. – Patrick Harrington Aug 4 '14 at 23:42
  • And, of course, this bug has been known about in Drupal for about two years. But the beauty of the FOSS system means that it's been bantered about the right way to fix it for two years rather than actually fixing it: drupal.org/node/1796596 </rant> God, I love Craft – Patrick Harrington Aug 4 '14 at 23:45
  • Thank you for the replies! I'll have to take a look at those plugins, thanks Brad. The idea of "onMoveStructuredEntry" would be great. – Josh Aug 6 '14 at 19:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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