arc_redirect (Love Redirects, Hate 404s)

If you’re in the process of restructuring a Textpattern site, then this is the plugin for you!

Requirements:-

  • Textpattern 4.5+

Installation

To install go to ‘Plugins’ under ‘Admin’ and paste the plugin code into the ‘Install plugin’ box, ‘upload’ and then ‘install’. You will then need to activate the plugin.

Uninstall

To uninstall arc_redirect simply delete the plugin from the ‘Plugins’ tab. This will remove the plugin code and drop the arc_redirect table from your Textpattern database.

Usage

arc_redirect adds a new tab under ‘Extensions’ from where you can define pairs of URLs for handling redirects. Basically provide an original URL on your Textpattern site that is generating a 404, “page not found”, error and a redirect URL. Then whenever someone goes to the original URL rather than get the standard 404 error page they will be redircted to the new URL (with a 301 permenantely moved, or 302 temporarily removed).

The redirect from URL must produce a 404 page in Textpattern on the site this plugin is installed.

  • arc_redirect treats http://www.example.com/missing the same as http://www.example.com/missing/
  • arc_redirect does not treat http://example.com/missing and http://www.example.com/missing as the same URL
  • You can use absolute URLs like /missing

Author

Andy Carter. For other Textpattern plugins by me visit my Plugins page.

Thanks to Oliver Ker for giving me the idea for this plugin.

The Details


Comments

  1. Doug (Bristol Wen Design) |

    Fantastic and very timely plugin! Hopefully this will save me tons of time tinkering with htaccess files!

    Any chance of wildcard redirects and/or a way of importing a csv file? This would be especially handy with some of the larger sites I’m trying to migrate to Textpattern.

    Keep up the great work. Appreciated!

  2. Andy |

    @Doug, the CSV idea is good and not far off some of the ideas I’ve been knocking around. As for wildcard redirects, I considered this but as far as I am aware this cannot be done with the way the redirects are being checked in the database. In this scenario I think tinkering in the .htaccess file would be a better solution.

  3. Doug (Bristol Web Design) |

    Thinking about it, I can see how implementing wildcards would be a bit of a nightmare and realistically this is only likely when a site is initially ported to Textpattern. I’ll just use the traditional .htaccess approach. CSV import/export would still be nice! ;-)

    Also be nice if the plugin kept track of 404’s too and added those to a list of suggested redirects. Save having to keep an eye on the logs/webmaster tools and provides a nice way to get those urls into the plugin.

    By the way, don’t let these suggestions stop you from arc_twitter!

    All the best,